How to use the converter
Type a whole number, choose the base it is written in (From base) and the base you want (To base), then press Convert. The result card shows the number in binary, octal, decimal and hexadecimal at once, plus your chosen base if it is not one of those four. The details panel shows how the decimal value is turned into the target base by repeated division.
Input tips:
- Letters stand for digits above 9: A = 10, B = 11, up to Z = 35. Upper or lower case is fine.
- The prefixes
0b(binary),0o(octal) and0x(hexadecimal) are accepted when they match the selected base. - Spaces and underscores can group digits, for example
1111_0000or1 000 000. - A leading minus sign is allowed. Negative numbers are shown as a minus sign plus the converted size, not in two's complement.
There is no fixed size limit: the converter uses exact big-integer arithmetic, so numbers far beyond 64 bits convert without rounding. Input is limited to 1,000 digits.
How base conversion works
In base b, each position is worth b times the position to its right. To read a number into decimal, multiply each digit by its place value and add. For example, hexadecimal 7E8 is:
7×16² + 14×16¹ + 8×16⁰ = 1792 + 224 + 8 = 2024
To write a decimal number in another base, divide by the base again and again and keep the remainders.
Worked example: 2024 to binary
- 2024 ÷ 2 = 1012, remainder 0
- 1012 ÷ 2 = 506, remainder 0
- 506 ÷ 2 = 253, remainder 0
- 253 ÷ 2 = 126, remainder 1
- 126 ÷ 2 = 63, remainder 0
- 63 ÷ 2 = 31, remainder 1
- 31 ÷ 2 = 15, remainder 1
- 15 ÷ 2 = 7, remainder 1
- 7 ÷ 2 = 3, remainder 1
- 3 ÷ 2 = 1, remainder 1
- 1 ÷ 2 = 0, remainder 1
Reading the remainders from the last step to the first gives 11111101000. The same number is 3750 in octal and 7E8 in hexadecimal: 2024 ÷ 16 = 126 remainder 8, 126 ÷ 16 = 7 remainder 14 (E), 7 ÷ 16 = 0 remainder 7.
Good to know
- Each hexadecimal digit stands for exactly four binary digits, and each octal digit for three, which is why programmers use them as short forms of binary.
- The details panel shows at most 30 division steps; very long conversions continue the same way.
- Only whole numbers are converted. Fractions such as 0.1 often have no finite form in other bases.
- In base 16,
0b101is read as the hexadecimal digits 0, B, 1, 0, 1, because B is a valid hex digit.