Binary, octal, hex and decimal: the same number, four ways
Published June 13, 2026
We count in tens out of habit — ten fingers, ten digits, 0 through 9. But ten is not special to a computer. The same quantity can be written in any base, and a few bases come up constantly in computing because they line up neatly with how machines store data. Once you see that a number and its base are two separate things, switching between binary, octal, hexadecimal and decimal stops feeling like magic.
What 'base' really means
The base is simply how many distinct digits you have before you carry over. Decimal (base 10) uses 0–9; after 9 you roll over to 10. Binary (base 2) uses only 0 and 1, so it carries far more often. Each position is a power of the base: in decimal the columns are 1, 10, 100; in binary they are 1, 2, 4, 8, 16. The number 13 is 'one ten and three' in decimal and 'one eight, one four, no two, one one' — 1101 — in binary.
Why each base is used
- Binary (base 2) is the machine's native language — every transistor is on or off, 1 or 0.
- Hexadecimal (base 16) is shorthand for binary: one hex digit equals exactly four bits, so long bit patterns become short and readable — that is why colours like #FF8800 and memory addresses use it.
- Octal (base 8) groups bits in threes and survives mainly in Unix file permissions like chmod 755.
- Decimal (base 10) is for humans — the format people read, write and reason about every day.
Converting without a calculator
To turn binary into decimal, write the place values above each bit (…16, 8, 4, 2, 1) and add up the ones that have a 1 under them: 1101 is 8 + 4 + 1 = 13. To go from decimal to binary, repeatedly halve the number and read the remainders from bottom to top. Hex is easiest via binary: split the bits into groups of four and translate each group to a single hex digit, since four bits cover exactly 0 to 15.
The arithmetic is mechanical, which is exactly the kind of thing worth handing to a tool once you understand it. Our number-base converter shows all four bases side by side as you type, the text-to-binary tool maps each character to its bits, and the number-to-words converter spells decimals out in full — all locally, with nothing sent to a server.