HomeGuides Number Bases Explained: Binary, Hex and Decimal

Number Bases Explained: Binary, Hex and Decimal

We count in tens out of habit, not necessity. Computers count in twos, and programmers often write in sixteens. Once you see that a "base" is just how many digits you count with before rolling over, binary and hex stop being mysterious.

What a base is

A base is how many distinct digits you use before you need a new column. Decimal (base 10) uses 0-9; binary (base 2) uses only 0 and 1; hexadecimal (base 16) uses 0-9 then A-F for ten to fifteen. The idea of place value is the same in all of them — each column is worth the base times the one to its right.

How place value works

In decimal, 255 means 2 hundreds + 5 tens + 5 ones. In binary, 11111111 means 128+64+32+16+8+4+2+1 = 255. In hex, FF means 15 sixteens + 15 ones = 255. Same quantity, three notations — the value is identical, only the packaging differs.

Why programmers use hex

Binary is precise but long and easy to misread. Hex is compact because each hex digit maps to exactly four bits, so one byte is always two hex digits. That is why colour codes like #4F46E5, memory addresses and byte dumps are written in hex — it is binary you can actually read.

Converting between bases

To convert, read the number in its source base to get its plain decimal value, then re-express that value in the target base by repeatedly dividing and keeping remainders. It is fiddly by hand, so the Number Base Converter does it between binary, octal, decimal and hex instantly.

Frequently asked questions

Why do computers use binary? Because a circuit is easily on or off — two states — which maps directly to 1 and 0.

What is octal? Base 8 (digits 0-7); it still appears in things like file permissions.

Is hex hard to learn? No — it is just ten digits plus A-F for ten through fifteen, and each digit is a neat four bits.

Related tools

Last updated: August 27, 2026