Converters

Number Base Converter

Type a value into any of the four fields — decimal, binary, hexadecimal, or octal — and the other three update instantly. Conversions use big-integer math, so arbitrarily large whole numbers convert without rounding, and the summary shows standard prefixes (0b, 0x, 0o) plus the bit length.

Type in any field — the other three update live. Handles non-negative whole numbers of any size (big-integer math, no rounding). Hex accepts 0–9 and A–F; prefixes like 0x, 0b, 0o are ignored.

What a number base actually is

A base tells you how many symbols a counting system uses and what each column is worth. Decimal columns are powers of 10; binary columns are powers of 2, so 255 = 11111111 (eight 1s: 128+64+32+16+8+4+2+1); hex uses sixteen symbols (0–9, A–F) with columns worth powers of 16, so 255 = FF. Same quantity, three spellings — converting between bases never changes the number, only its representation.

Why programmers love hexadecimal

One hex digit encodes exactly four binary bits, so a byte (8 bits) is always two hex digits: 11111111 becomes FF, and 10100101 splits into 1010|0101 = A5. That clean 4-to-1 mapping is why memory addresses, color codes (#FF6600), MAC addresses, and hash values are written in hex — it's binary compressed for human eyes. Octal does the same trick with 3-bit groups and survives mainly in Unix file permissions like 755.

Reading the prefixes and bit length

The prefixes 0b, 0x, and 0o mark binary, hex, and octal in most programming languages — 0x10 is sixteen, not ten. The 'bits needed' figure is the length of the binary form, which tells you the smallest integer type that can hold the value: 255 fits in 8 bits, 256 needs 9, and anything over 32 bits won't fit a standard int in many languages.

How to use this converter

Type into any of the four fields — decimal, binary, hexadecimal, or octal — and the other three update instantly, so you can start from whichever base you already have. The summary line shows the value with standard prefixes (0b, 0x, 0o) and the number of bits its binary form needs, which tells you the smallest integer type that could hold it.

A worked example

Enter 420 in decimal. In binary that's 110100100 (256 + 128 + 32 + 4), which needs 9 bits. In hex it's 1A4 — group the binary into 4-bit nibbles from the right (1 1010 0100 → 1, A, 4). In octal it's 644, grouping into 3-bit chunks (110 100 100 → 6, 4, 4). One quantity, four spellings, and that nibble-grouping trick is exactly why hex and octal map so neatly onto binary.

FAQ

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

They mark the base in most programming languages: 0b for binary, 0x for hexadecimal, 0o for octal. So 0b1111, 0xF, 0o17, and 15 are all the same number.

Why is hexadecimal used for colors and memory addresses?

Each hex digit maps to exactly 4 binary bits, so a byte is always two hex digits. That makes hex a compact, lossless shorthand for binary — #FF6600 is three bytes: 255, 102, 0.

How large a number can this convert?

Effectively unlimited — it uses big-integer arithmetic rather than floating point, so numbers hundreds of digits long convert exactly with no rounding.

Does it handle negative numbers or fractions?

No, whole non-negative numbers only. Negative values in computing use representations like two's complement, which depend on a fixed bit width rather than a pure base conversion.

Is my data stored anywhere?

No. The converter runs entirely in your browser — nothing you type is sent to a server.

More free tools