Math Playground
Numbers

Number systems

Decimal, binary, hex, Roman — the same numbers in different alphabets.

We have ten fingers, so we count in tens. Computers have only on/off switches, so they count in twos. There's nothing magical about base 10 — we just chose it.

Numbers don't have to be written in tens. Decimal (base 10) is just one option — computers use binary (base 2), programmers like hexadecimal (base 16), and the Romans had no zero at all.

Where you'll meet this

Every byte of memory, every IP address, every colour on screen (#FF8800), every QR code is encoded in binary or hex. Programmers fluently switch between bases the way a chef switches knives.

computingcolournetworkinghistory

The big four

  • Decimal — digits 0–9, place values 1, 10, 100, 1000…
  • Binary — digits 0 and 1, place values 1, 2, 4, 8, 16…
  • Hexadecimal — digits 0–9 and A–F, place values 1, 16, 256…
  • Roman numerals — I, V, X, L, C, D, M with no zero

How any base works

In base b, the rightmost digit is worth 1, the next is worth b, then b², then b³, and so on. To convert TO another base, repeatedly divide and keep the remainders. To convert FROM another base, add up the place-value contributions.

Try it

13 in binary?

8 + 4 + 0 + 1 = 13, so 1101.

Try it

255 in hex?

FF (15 sixteens + 15).

Your turn

What is the binary number 10110 in decimal?

Hex is shorthand for binary: every hex digit packs four binary digits. FF is 11111111.

Watch out

When you read '10' out loud, the answer depends on the base. In binary it's two, in decimal it's ten, in hex it's sixteen. The symbols don't tell you the base — context does.

Recap
  • A base sets how many digits exist and the place-value pattern.
  • Binary uses 2 digits, decimal uses 10, hex uses 16. The mathematics is the same — only the digits differ.
  • Hex is a compact stand-in for binary: 1 hex digit = 4 binary digits.