Number Base Converter
Type an integer and see it in binary, octal, decimal, and hexadecimal at once, updating as you go. The auto mode reads 0x, 0b, and 0o prefixes for you, values can be any size (BigInt), and you also get the bit length, byte length, big-endian byte breakdown, and the Unicode character. Everything runs in your browser.
How number bases work, and what the prefixes mean
Positional bases
Every base writes a number as a sum of powers of that base. In decimal (base 10) the digits 0 to 9 sit in columns worth 1, 10, 100, and so on, so 255 means 2 hundreds plus 5 tens plus 5 ones. Binary (base 2) uses only 0 and 1 with columns of 1, 2, 4, 8; octal (base 8) uses 0 to 7; and hexadecimal (base 16) uses 0 to 9 then a to f for the values 10 to 15. The number itself does not change between bases, only the way it is written down.
The 0x, 0b, and 0o prefixes
Because the same digits can be read in different bases, code marks the base with a prefix. 0x means hexadecimal, 0b means binary, and 0o means octal (an older style used a bare leading zero for octal, which is easy to misread, so the explicit 0o is preferred). With no prefix the value is read as decimal. In auto-detect mode this tool follows those rules, and as a convenience it also reads a prefix-free value containing a to f as hexadecimal.
Why hex maps cleanly to bits
Sixteen is two to the fourth power, so one hex digit encodes exactly four bits (a nibble) with no overlap. That is why a byte is two hex digits and why memory dumps, color codes, and hashes are written in hex: it is a compact, exact shorthand for the underlying binary. Octal works the same way for groups of three bits, which is where Unix file permissions like 0o755 come from.
Signed versus unsigned, and negatives
The bit length and byte breakdown shown here treat the value as a non-negative (unsigned) integer, which is the natural reading for a plain magnitude. Computers also store signed numbers using two's complement, where the top bit carries a negative weight and the same bit pattern can mean a positive or a negative number depending on the type width (for example the byte 0xFF is 255 unsigned but -1 as a signed 8-bit value). To keep results unambiguous this tool accepts only non-negative integers; a leading minus sign is reported as an error rather than guessed at, since the correct two's-complement form depends on a bit width you would need to choose. Conversions use BigInt, so values can be arbitrarily large with no loss of precision.