What is Hexadecimal? How to Read Hex Numbers
Hexadecimal — hex for short — is a base-16 number system: it counts using sixteen symbols, the familiar 0–9 followed by the letters A through F. It's the standard way programmers write bytes, because one byte fits perfectly into exactly two hex digits. The color #FF6600, the hash a94a8fe5, the memory address 0x7FFF5C — all hex, all readable in a minute once you know the trick.
Why does a color picker hand you letters mixed in with your numbers? That question is really asking how base-16 counting works, and the answer is friendlier than it looks. Let's build it from something you already understand: an odometer.
Counting past 9: where A–F come from
Ordinary decimal counting is an odometer with ten symbols per wheel. You count 0 through 9, run out of symbols, roll the wheel back to 0, and tick the next wheel up: 10. Every number system works exactly this way — the only choice is how many symbols each wheel holds.
Hexadecimal's odometer has sixteen positions per wheel. After 9 you don't roll over yet — you keep going through six more symbols, and since we ran out of digits, the alphabet lends a hand: A is 10, B is 11, C is 12, D is 13, E is 14, F is 15. Then the wheel rolls: after F comes 10, which in hex means sixteen, not ten.
So the hex sequence runs: ... 8, 9, A, B, C, D, E, F, 10, 11 ... and each wheel is worth sixteen times the wheel to its right. That's the entire system. If the odometer picture clicked, everything below is just reading practice.
Two hex digits = one byte (the reason hex exists)
Computers store everything in bytes of 8 bits, and writing bits out longhand gets old fast — 11111111 is one byte, and a hash digest is 32 of those. Hex fixes this with a mapping that isn't approximate but exact: one hex digit holds precisely 4 bits (a nibble), so one byte is always exactly two hex digits.
| Binary | Hex | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 1010 | A | 10 |
| 1111 | F | 15 |
| 1111 1111 | FF | 255 |
| 0100 1000 | 48 | 72 |
This is why hex, and not decimal, became the byte notation: converting between hex and binary needs no arithmetic at all — you translate nibble by nibble, in either direction, digit for digit. Decimal can't do that; 255 tells you nothing about its bits at a glance, but FF tells you every bit is on. If you read our guide to reading binary, hex is the shorthand for everything you decoded there: the byte 01001000 (the letter H) compresses to 48.
Reading hex in the wild
Once you know the two-digits-per-byte rule, hex starts announcing itself everywhere:
- CSS colors. #FF6600 is three bytes: FF red (255, full), 66 green (102), 00 blue (none) — a strong orange. Decode any color with the Hex to RGB converter.
- Hash digests. A SHA-256 hash shown as 64 hex characters is really 32 bytes, two characters each.
- Memory addresses and error codes. The 0x prefix — 0x7FFF5C, 0xC0000005 — is code for "this number is hex."
- Unicode code points. U+00E9 is é; the number after U+ is hexadecimal, which is also what numeric HTML entities like é use.
- Hex dumps. When a debugger shows you file contents as 48 65 6C 6C 6F, that's bytes in hex — paste them into a Hex to Text converter and it reads "Hello".
Convert hex by hand: two worked examples
Hex → decimal. Each position is a power of 16, rightmost first. Take 2A: the 2 sits in the sixteens place and A is ten, so 2×16 + 10 = 42. Three digits work the same way with 256s: 1F4 is 1×256 + 15×16 + 4×1 = 500.
Hex → text. Take the dump 48 69. Each pair is one byte: 48 is 4×16 + 8 = 72, and 72 in ASCII is H. 69 is 6×16 + 9 = 105 — the letter i. The message says "Hi", and you just read a hex dump by hand.
Here's a self-check before you move on: what's FF in decimal? Fifteen sixteens plus fifteen — 255. If you got there without a calculator, you can read hex.
When the letters trip people up
Two honest warnings from the wild. First, case is meaningless — a9 and A9 are identical — but mixed conventions across tools make people think it matters. Second, a hex string that happens to contain only digits, like 100, is ambiguous without context: decimal one hundred or hex 256? That's the entire job of the 0x prefix and the # in CSS — read them as "hex ahead" and the ambiguity disappears.
Try it yourself
All browser-based, nothing uploaded:
- Hex to Text — decode hex dumps into readable text instantly.
- Text to Hex — see any string as the bytes it really is.
- Hex to RGB — split color codes into their red, green, and blue bytes.
- Binary to Text — the longhand version, for when you want to see every bit.
Conclusion
Hexadecimal is an odometer with sixteen positions per wheel: 0–9, then A–F, then roll over. One digit is four bits, two digits are a byte, and that exact fit is why programmers write bytes in hex everywhere from CSS colors to hash digests. Learn to read pairs — FF is 255, 48 is H — and hex dumps, color codes, and 0x-prefixed mysteries all become plain text you happen to know how to skim.
Try the tools
Frequently Asked Questions
What does hexadecimal mean?
Hexadecimal means base-16: a number system with sixteen symbols instead of ten. It uses 0–9 for the first ten values and the letters A–F for ten through fifteen, so a single hex digit can hold any value from 0 to 15.
Why does hexadecimal use letters?
Base-16 needs sixteen distinct symbols and our digits stop at 9, so the first six letters of the alphabet fill in: A=10, B=11, C=12, D=13, E=14, F=15. Case doesn't matter — ff and FF are the same value.
Why do programmers use hex instead of binary?
Compactness with a perfect mapping. Each hex digit corresponds to exactly 4 bits, so one byte is always two hex digits. FF is far easier to read, write, and compare than 11111111, yet converts to and from binary digit by digit.
What does 0x mean in front of a number?
The 0x prefix marks a number as hexadecimal so it can't be confused with decimal — 0x10 is sixteen, not ten. Most programming languages use it; CSS uses # instead, as in #FF6600.
How do I convert hex to decimal by hand?
Multiply each digit by a power of 16 based on its position, rightmost being 16⁰. For 2A: 2×16 + 10×1 = 42. For three digits like 1F4: 1×256 + 15×16 + 4 = 500.
CodeUtilityKit Team builds free, privacy-first developer tools that run entirely in your browser. Every guide is written and reviewed by developers who use these tools daily.