Binary, Decimal and Hexadecimal, Explained for Humans
Binary and hexadecimal have a reputation for being intimidating, but the idea behind them is something you already understand — you just use it without thinking. This guide demystifies number bases: what "base" means, how binary and hex actually work, why computers rely on them, and the everyday places they show up. No advanced maths required.
What "base" even means
The numbers you use every day are "base 10", or decimal. That means you have ten digits (0–9), and when you run out, you add a new column. The number 254 really means (2 × 100) + (5 × 10) + (4 × 1). Each column is worth ten times the one to its right. There's nothing sacred about ten — we use it mostly because we have ten fingers. A "base" is simply how many digits you have before you need a new column.
Binary: base 2, the language of computers
Binary has just two digits: 0 and 1. Each column is worth twice the one to its right — 1, 2, 4, 8, 16, and so on. So the binary number 1011 means (1×8) + (0×4) + (1×2) + (1×1) = 11 in decimal. That's it; it's the same column idea, just with two digits instead of ten.
Why do computers use it? Because at the physical level a computer is made of billions of tiny switches, and a switch has two states: on or off. Representing those as 1 and 0 maps perfectly onto binary. Everything a computer does — numbers, text, images, sound — is ultimately stored as long strings of these two digits. A single binary digit is called a bit, and eight bits make a byte, which can represent 256 different values (from 0 to 255). That "256" turns up everywhere once you know to look for it.
Hexadecimal: base 16, binary's convenient shorthand
Binary is perfect for machines but painful for humans — the numbers get long fast. The byte for 255 is 11111111, and nobody wants to read pages of that. Hexadecimal solves this. It's base 16, so it needs sixteen digits: 0–9 for the first ten, then A, B, C, D, E, F for ten through fifteen. So F means 15, and 10 in hex means sixteen.
The magic is that one hex digit corresponds exactly to four binary digits. That means a byte (8 bits) is always exactly two hex digits. The unwieldy 11111111 becomes a tidy FF. This clean mapping is why programmers use hex constantly as a compact, human-friendly stand-in for binary.
Where you'll actually meet these
You run into number bases far more often than you'd guess:
- Colours on the web. A hex colour like
#2563EBis three bytes — two hex digits each for red, green and blue. FF is the maximum (255) of a channel, 00 the minimum. Understanding hex makes colour codes readable rather than mysterious. See our guide on colour models. - File sizes and memory. The reason a "kilobyte" is sometimes 1024 rather than 1000 bytes is that 1024 is a round number in binary (2 to the tenth power).
- Memory addresses and low-level programming. These are almost always shown in hex because of its clean relationship to bytes.
- Encoding schemes. Systems like Base64 exist to represent binary data safely as text, another twist on the base idea.
Converting between them
You rarely need to convert bases by hand, but knowing it's possible — and reversible — takes the fear out of it. Every whole number has an exact representation in every base; they're just different ways of writing the same value. Decimal 255, binary 11111111, and hex FF are the identical quantity. When you need to switch, our number base converter does it live: type into any base and the others update, so you can build intuition by watching how a value looks across binary, octal, decimal and hex.
A small mental model
If you remember one thing, make it this: a base is just "how many digits before you add a column", and every base describes the same numbers differently. Binary is what the hardware speaks, hexadecimal is the readable shorthand for binary, and decimal is what humans find natural. They're three views of one underlying thing, and moving between them is always exact.
A note on octal, the forgotten base
You'll occasionally meet a fourth base: octal, or base 8, which uses digits 0–7. It's less common today but still shows up in one famous place — file permissions on Unix and Linux systems, where a value like 755 is octal. Octal exists for the same reason as hex: it groups binary neatly, three bits per octal digit. Hex won out for most uses because it maps to bytes so cleanly (two digits per byte), but octal lingers where its three-bit grouping fits the problem. The broader point is that bases aren't rivals; each is chosen because its grouping happens to line up with the thing being described. Once you see a base as "a convenient way to group bits," the whole topic stops feeling arbitrary.
Key takeaways
- A number "base" is how many digits you use before adding a new column (decimal = 10, binary = 2, hex = 16).
- Computers use binary because hardware switches are on/off; 8 bits make a byte (0–255).
- Hexadecimal is compact shorthand for binary — one hex digit equals four bits, so a byte is two hex digits.
- Hex is everywhere: colour codes, memory, file sizes. Converting between bases is always exact and reversible.