NUMBER TOOL

Number base converter

Convert a whole number between binary, octal, decimal, hexadecimal or any base from 2 to 36. Prefixes such as 0x, 0b and 0o are recognised, and very long numbers stay exact.

← All converters
FF

Binary 1111 1111 · Octal 377 · Decimal 255 · Hex FF

HOW IT WORKS

The rules

Every base writes numbers with place values that are powers of the base. In binary the places are 1, 2, 4, 8, 16 and so on, so 1101 is 8 + 4 + 1 = 13. Hexadecimal uses the digits 0 to 9 and A to F for 10 to 15, so FF is 15 × 16 + 15 = 255.

The converter uses whole-number arithmetic with no rounding, so values with hundreds of digits are converted exactly.

ALSO IN THE SMART BOX

Ask in plain words

The box on the Convert page answers the same questions as you type, for example “120000 in words”, “1994 in roman”, “255 in binary” or “0.375 as a fraction”.

EXAMPLES

Common values in four bases

DecimalBinaryOctalHexadecimal
0000
1111
21022
711177
81000108
10101012A
15111117F
161 00002010
3210 00004020
64100 000010040
100110 010014464
127111 11111777F
1281000 000020080
2551111 1111377FF
2561 0000 0000400100
1,00011 1110 100017503E8
1,024100 0000 00002000400
4,0961 0000 0000 0000100001000
65,5351111 1111 1111 1111177777FFFF
QUESTIONS

Common questions

How do I convert decimal to binary?

Divide by 2 repeatedly and write the remainders from last to first. 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1 and 1 ÷ 2 = 0 remainder 1, so 13 is 1101.

What do 0x, 0b and 0o mean?

They are prefixes used in programming: 0x marks hexadecimal (0xFF = 255), 0b binary (0b1010 = 10) and 0o octal (0o17 = 15). The converter recognises them automatically.

Is there a size limit?

Numbers of up to 256 digits are converted exactly, because the converter uses whole-number arithmetic with no rounding.