Last updated 3 September 2026
What "base" means
A number base is how many distinct digits a system uses before carrying to a new place value. Decimal (base 10, what people use day to day) has digits 0-9. Binary (base 2) has only 0 and 1 — the language computer hardware actually runs on. Hexadecimal (base 16) adds A-F to 0-9, giving a much more compact way to represent the same binary values, which is why it shows up constantly in programming, color codes and memory addresses.
Why hexadecimal exists
Computers work in binary, but binary is miserable to read — a single byte is eight digits, and a memory address can run to thirty-two or sixty-four. Hexadecimal solves this cleanly because 16 is a power of 2: every hex digit maps to exactly four binary digits, with no arithmetic needed to convert.
So 11111111 splits into 1111 1111, each half is F, and the byte is FF. Two characters instead of eight, with a direct one-to-one relationship you can do in your head once you know the sixteen mappings. That is the entire reason hex shows up in colour codes, memory dumps, MAC addresses and error codes.
A worked example
Take the CSS colour #3A7BD5. Split it into three pairs: 3A, 7B, D5. Each pair is one byte, so red is 3×16 + 10 = 58, green is 7×16 + 11 = 123, and blue is 13×16 + 5 = 213. That gives rgb(58, 123, 213) — the same colour written two ways, which is why a design tool can move between the formats without any loss.
Reading binary works the same way with powers of two. 1011 is 8 + 0 + 2 + 1 = 11. Going the other direction, halving repeatedly and recording the remainders gives the digits in reverse: 11 halves to 5 remainder 1, then 2 remainder 1, then 1 remainder 0, then 0 remainder 1 — read upwards, that is 1011.
Common questions
What is a number base?
It's how many distinct digits a counting system uses before it carries over to a new place value. Decimal (base 10) uses 0-9, binary (base 2) uses only 0 and 1, octal (base 8) uses 0-7, and hexadecimal (base 16) uses 0-9 plus A-F.
Why does programming use hex and binary at all?
Computers store everything as binary at the hardware level, but long strings of 1s and 0s are hard for people to read. Hexadecimal compresses that same binary value into a much shorter, easier-to-scan form — which is why colors, memory addresses and byte values are usually shown in hex.
Can I enter negative numbers?
No — this tool works with non-negative whole numbers only, which covers the large majority of everyday binary/hex conversion needs like color codes and byte values.
Why does programming use hexadecimal so often?
Because 16 is a power of 2, each hex digit maps to exactly four binary digits with no calculation. A byte that takes eight binary digits fits into two hex characters, which makes memory addresses, colour codes and error values far easier to read and write.
How do I read a colour code like #3A7BD5?
Split it into three pairs — 3A, 7B, D5 — one each for red, green and blue. Each pair is a byte from 0 to 255, so this is rgb(58, 123, 213). FF is the maximum of 255 and 00 is zero, which is why #FFFFFF is white and #000000 is black.
What do the letters A to F represent?
The values ten through fifteen. Hexadecimal needs sixteen distinct digits, and the decimal system only supplies ten, so letters fill the remaining six places. A is 10, B is 11, and so on up to F, which is 15.