Number Base Systems Explained: Binary, Hex, and Beyond

Number base systems explained: positional notation, why humans use base 10, how binary (base 2), octal (base 8), and hexadecimal (base 16) work, why computers use base 2, and how to convert between any base 2-36. With worked examples and a free base converter.

We count in base 10 because we have ten fingers, but a number base is just a choice of how many digits we use before carrying to the next column. Computers force a different choice — base 2 — and programmers often reach for base 16 to make base 2 readable. Understanding positional notation is the key that unlocks all of them.

1. Positional notation: the idea behind every base

Every number base is positional: the value of a digit depends on where it sits. In base 10, the columns are ones, tens, hundreds, thousands — each one ten times the last. A base-b system simply replaces that 10 with b: the columns are ones, b's, b²'s, b³'s, and so on.

value = d₀×b⁰ + d₁×b¹ + d₂×b² + …   (counting digits right to left)

The base also fixes how many distinct digits exist before a carry: base 10 uses 0-9, base 2 uses 0-1, base 16 needs 16 symbols and borrows letters (0-9 then A-F). Once you grasp that a base is "the multiplier between columns and the count of available digits," every base system is the same idea with a different number plugged in.

2. Why humans use base 10 (and why it is arbitrary)

Base 10 is almost certainly a biological accident — ten fingers, ten digits. There is nothing mathematically special about 10. Base 12 would actually be more convenient (12 divides by 2, 3, 4, and 6, making fractions cleaner), which is why we still measure time in 12s and 60s and buy eggs by the dozen. The point is that 10 is a convention, not a truth, which is exactly why other bases make sense in other contexts.

3. Binary (base 2): the language of hardware

Computers use base 2 because digital hardware is built from switches with only two stable states — on and off — which map cleanly to the digits 1 and 0. Every number, letter, color, and instruction inside a computer is ultimately a long string of bits. Binary columns are ones, twos, fours, eights, sixteens:

1011 (binary) = 1×8 + 0×4 + 1×2 + 1×1 = 11 (decimal)

Base 2 is also the simplest system to build error-free logic for: every operation reduces to AND, OR, and NOT on single bits. Higher bases would require hardware that reliably distinguishes more than two voltage levels, which is far harder and far less robust — so binary wins on engineering grounds, not mathematical ones.

4. Hexadecimal (base 16) and octal (base 8): for humans reading binary

Reading raw binary is painful — a byte is eight 0s and 1s. Hexadecimal (base 16) is a compact shorthand because one hex digit maps exactly to four binary digits, so a byte is always exactly two hex digits. The byte 11110000 is simply F0. Octal (base 8) maps one digit to three bits and survives in Unix file permissions (755, 644) for the same reason — three permission bits per digit.

F0 (hex) = 1111 0000 (binary) = 240 (decimal)
755 (octal) = 111 101 101 (binary) = rwx r-x r-x permissions

Hex and octal are not different number systems doing different work — they are viewing angles on the same underlying binary, chosen because they line up evenly with bit boundaries.

5. Converting between bases

To convert from any base to decimal, use the positional sum: multiply each digit by the base raised to its position (starting at 0 on the right) and add. To convert from decimal to any base, repeatedly divide by the target base and read the remainders from bottom to top.

1A (base 16) → decimal: 1×16¹ + 10×16⁰ = 16 + 10 = 26
26 (decimal) → base 2:   26 ÷ 2 = 13 r0, 13 ÷ 2 = 6 r1, … → 11010

The same two methods work for any base 2 through 36 (36 is the practical limit because we run out of digit symbols at 0-9 plus A-Z). For numbers larger than the safe integer range, a converter using BigInt keeps the integer part exact.

Try it yourself

The Base Converter converts numbers between any radix 2-36, including fractional and signed values, and shows the reference binary/octal/decimal/hex results. For the common 2/8/10/16 case, the Binary Converter is a focused version, and the ASCII Text Converter shows how text maps to numeric codes — the bridge between characters and the bytes that store them.

Frequently asked questions

What is a number base?
A number base (or radix) is how many distinct digits a system uses before it rolls over and carries to the next column. Base 10 uses ten digits 0-9, base 2 uses two digits 0-1, and base 16 uses sixteen symbols 0-9 and A-F. The base is the multiplier in positional notation: in base 10, the columns are ones, tens, hundreds; in base 2 they are ones, twos, fours, eights.
Why do computers use binary?
Because digital hardware is built from switches that have only two stable states — on and off — which map cleanly to the digits 1 and 0. Base 2 is also the simplest system to design error-free logic for: every operation is a combination of AND, OR, and NOT on single bits. Higher bases would require hardware that reliably distinguishes more than two voltage levels, which is far harder.
Why do programmers use hexadecimal?
Because one hex digit maps exactly to four binary digits (a nibble), so a byte (8 bits) is always exactly two hex digits. Hex is a compact, human-readable way to write binary: the byte 11110000 is simply F0. Octal (base 8) maps to three bits and shows up in Unix file permissions for the same reason.
How do I convert a number from one base to another?
The general method is positional: multiply each digit by base raised to its position (counting from 0 at the right), and sum. To convert 1A in base 16 to decimal: 1×16^1 + 10×16^0 = 16 + 10 = 26. To go from decimal to another base, repeatedly divide by the target base and read the remainders bottom-up.