Number Base Converter

Convert between binary, octal, decimal, and hexadecimal instantly

Invalid binary number.
Invalid octal number.
Invalid decimal number.
Invalid hexadecimal number.

Arbitrary Base Conversion

How to use the Number Base Converter

To convert between number bases, type a value into the binary, octal, decimal, or hexadecimal field and the other three update instantly. For unusual bases, use the arbitrary base section to convert between any base from 2 to 36. It runs in your browser and is free with no signup.

  1. Type in any base Enter your value in the binary, octal, decimal, or hex field.
  2. Read the other bases The remaining fields update automatically with the converted values.
  3. Use arbitrary bases if needed Set a from-base and to-base between 2 and 36 to convert unusual bases.
  4. Copy the result Click copy to use the converted number in your code or notes.

About Number Base Conversion

A number base (or radix) defines how many unique digits are used to represent numbers. Decimal (base 10) uses digits 0-9, binary (base 2) uses 0-1, octal (base 8) uses 0-7, and hexadecimal (base 16) uses 0-9 and A-F. Converting between bases is a common task in programming, networking, and digital electronics.

This converter keeps all four common bases in sync as you type, and also supports any arbitrary base from 2 to 36 (using digits 0-9 and letters A-Z). For example, decimal 255 equals binary 11111111, octal 377, and hexadecimal FF.

Frequently Asked Questions

Each binary digit represents a power of 2, starting from the rightmost bit (2^0). Add up the powers of 2 wherever there is a 1. For example, 1011 = 8 + 0 + 2 + 1 = 11 in decimal. This tool does the math for you instantly.

Repeatedly divide the decimal number by 16 and record the remainders, which become hex digits (using A-F for 10-15). Read the remainders from bottom to top. For example, 255 divided by 16 is 15 remainder 15, giving FF. Just type your number in the decimal field to see the hex result.

Hexadecimal is widely used in computing because each hex digit maps neatly to four binary bits. It's common for memory addresses, color codes (like #FF6347), MAC addresses, and representing byte values compactly. Two hex digits represent exactly one byte.

The arbitrary base converter supports bases from 2 to 36. This is because base 36 uses all ten digits (0-9) plus all 26 letters (A-Z), which is the largest base representable with standard alphanumeric characters.

Conversions use standard JavaScript numbers, which are accurate up to 2^53 - 1 (about 9 quadrillion). Beyond that, precision may be lost. For typical programming and everyday use, this range is more than sufficient.

Related Tools