Number base converter
Type a number in binary, octal, decimal, hex or any base from 2 to 36, and see it in all the others at once. Integers of any size stay exact.
Worked example
The largest unsigned 64-bit integer, 2⁶⁴ − 1, written in decimal, hex and base 36.
18446744073709551615
FFFFFFFFFFFFFFFF 3W5E11264SGSF
Common mistakes
Leaving a 0x prefix in a decimal field
0x10 is 16, not 10. The converter tells you when a prefix doesn’t match the field you typed in.
Reading 010 as ten
In some languages a leading 0 means octal, so 010 is 8. Here, leading zeros are ignored in every field, and octal is only octal in the octal field.
Trusting a spreadsheet with big numbers
Spreadsheets and JavaScript numbers keep about 15–17 significant digits, so 64-bit IDs get rounded. This converter is exact at any length.
Mixing up the letter O and zero
In bases above 24, O is a digit worth 24. Check the error message if a value looks wrong.
How it works
- 1
Type in any field
Binary, octal, decimal, hexadecimal, or the custom base. The other fields update as you type.
- 2
Use the notation you have
Prefixes like 0x, 0b and 0o, a minus sign, and underscores or spaces between digits are all accepted. An invalid digit is named, with its position.
- 3
Copy the result
Each field has a copy button. Turn on Group digits to read long binary in groups of 4 and hex in pairs.
Questions
- How do I convert binary to decimal by hand?
- Multiply each digit by 2 raised to its position, counting from 0 on the right, and add them up: 1011 is 8 + 0 + 2 + 1 = 11.
- Why does each hex digit match four binary digits?
- Because 16 is 2⁴. That makes hex a compact way to write binary: 1111 0000 is F0, and a byte is always two hex digits.
- Is there a size limit?
- No practical one. The converter uses JavaScript BigInt, so a 1,000-digit number converts exactly, unlike calculators that round after about 16 digits.
- How are negative numbers shown?
- With a minus sign in every base: -255 is -ff in hex. The converter doesn’t show two’s complement, because that depends on a fixed bit width.
- Can it convert fractions?
- No, only whole numbers. Fractions often have no exact form in another base: 0.1 in decimal repeats forever in binary.