HomeGuides Number Bases Explained: Binary, Hex and Decimal

Number Bases Explained: Binary, Hex and Decimal

We count in tens, but computers count in twos, and programmers often use sixteens. Understanding number bases makes file sizes, color codes and low-level data far less mysterious.

What a "base" means

A base is how many digits a system uses before it rolls over to the next place. 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.

Why computers use binary

At the hardware level everything is on/off — 1 or 0. So computers store and process numbers in binary. Eight bits make a byte, which can represent 256 values (0–255) — exactly the range of one RGB color channel.

Why programmers love hex

Binary is long and error-prone to read. Hex is compact: each hex digit maps to exactly four bits, so one byte is just two hex digits. That is why color codes (#4F46E5) and memory addresses are written in hex.

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. The Number Base Converter does this between binary, octal, decimal and hex instantly.

Related tools

Last updated: July 6, 2026