Number base converter
Convert between decimal, binary, hexadecimal and octal. Type in any base: 255, FF and 11111111 are the same number.
That's 2.8× as big as a nibble (4 bits), while a byte is 6.1× bigger. That needs 6 bits to store.
What it means
How big is that?
Whole numbers only. Anything after the decimal point is rounded away.
Every unit
Your number in every base
Learn
Three things worth knowing
-
One hex digit is four bits
F is 1111, and FF is 11111111, which is 255. That is why colors are written #FF8800: three bytes, two hex digits each.
-
Why octal existed
Early computers used 12, 24 or 36-bit words, all divisible by three, so octal grouped the bits neatly. When 8-bit bytes won, hexadecimal took over.
-
0x, 0b and leading zeros
A leading 0 means octal in some languages, so 010 is 8 rather than 10. Prefixes 0x and 0b exist to remove the guesswork.
Shortcuts
Popular number conversions
Background
About number bases
Decimal counts in tens because we have ten fingers. Computers count in binary, because a wire is either on or off. Hexadecimal is shorthand for binary: one hex digit is exactly four bits, so a byte is always two hex digits.