Hexadecimal — "hex" for short — is the base-16 number system, and once you learn to read it, you'll start seeing it everywhere: in code, in debuggers, in the color picker of every design tool. This guide explains what hex is, how to read values like 0xFF, and walks through a real color code, #FF5733, channel by channel.
The sixteen digits
Decimal needs ten digits (0–9). Hexadecimal needs sixteen, so after 9 it borrows letters: A=10, B=11, C=12, D=13, E=14, F=15. Counting in hex goes: 0, 1, … 9, A, B, C, D, E, F, 10 (which means sixteen!), 11, … 1F, 20… The reason for sixteen digits is beautiful: one hex digit = exactly 4 bits, so two hex digits describe a full byte with zero waste.
Reading hex values
Hex is positional like decimal, but each position is worth a power of 16. Take FF:
- F in the "sixteens" place: 15 × 16 = 240
- F in the "ones" place: 15 × 1 = 15
- Total: 255 — the maximum value of a single byte
Another: 2F = (2 × 16) + 15 = 47. And 100 in hex = 1 × 256 = 256 in decimal (each new digit multiplies by 16) — our decimal to binary converter shows 256 as 100000000₂, a 1 followed by eight zeros. In code you'll usually see hex with a 0x prefix — 0xFF — which simply announces "this number is hexadecimal, not decimal." Practice with our hex to decimal converter or go the other direction with decimal to hex.
Hex color codes, decoded
A CSS color like #FF5733 is just three hex bytes stuck together: red, green, blue — the #RRGGBB format. Let's decode it:
| Channel | Hex pair | Calculation | Decimal (0–255) |
|---|---|---|---|
| Red | FF | 15×16 + 15 | 255 |
| Green | 57 | 5×16 + 7 | 87 |
| Blue | 33 | 3×16 + 3 | 51 |
So #FF5733 = rgb(255, 87, 51) — full red, a little green, a little blue: a vivid orange-red. More landmarks to calibrate your eyes:
#000000— all channels off: black#FFFFFF— all channels maxed: white#FF0000— pure red;#00FF00pure green;#0000FFpure blue#808080— mid gray (128, 128, 128)
A useful fact: because each channel is a full byte, the 16.7 million possible colors from #000000 to #FFFFFF exactly match what a 24-bit display can physically show — no more, no less. That's why hex became the native tongue of digital color rather than some more "human" notation.
You'll also see the 3-digit shorthand: #F53 means #FF5533 — each digit is doubled. And an optional 4th/8th pair (#FF573380) adds an alpha (transparency) channel.
Converting RGB back to hex
Going the other direction: take rgb(255, 87, 51) and divide each channel by 16. 255 ÷ 16 = 15 remainder 15 → FF. 87 ÷ 16 = 5 remainder 7 → 57. 51 ÷ 16 = 3 remainder 3 → 33. Concatenate the pairs: #FF5733. (Our decimal to hex converter does these division steps for you.) Designers run this conversion constantly when translating between design tools that show RGB sliders and CSS that wants hex.
Hex in programming languages
Every mainstream language speaks hex. In C, Python, and JavaScript, 0xFF is an integer literal meaning 255. Python's hex(255) returns '0xff', while int('FF', 16) parses it back. Inside strings, "\x41" is "A" (a hex escape) and "\u00E9" is é. URLs percent-encode bytes as hex too — a space becomes %20 (0x20 = 32). Recognizing these half-dozen notations covers about 95% of the hex you'll ever meet in the wild.
Where else hex shows up
- Memory addresses — debuggers show pointers like
0x7ffee4b2a9c0 - MAC addresses —
3C:22:FB:91:4A:0D, six hex bytes identifying network hardware - UUIDs —
550e8400-e29b-41d4-a716-446655440000 - Error codes — Windows' infamous
0x80070005 - Unicode escapes —
\u00E9is é (code point E9₁₆ = 233)
In every case, hex is doing the same job: making long binary values short enough for humans to read without hiding the underlying bit pattern. If you can read hex, you can read the machine's mind — at least a little.
Convert any hex value to decimal with steps shown:
Open the Hex to Decimal ConverterFrequently asked questions
What is hexadecimal?
Hexadecimal (hex) is the base-16 number system. It uses sixteen digits — 0–9 plus A–F for values 10–15 — and each hex digit represents exactly 4 bits.
What does 0xFF mean?
0xFF is hexadecimal for 255. The 0x prefix marks the number as hex, and FF means 15×16 + 15 = 255 — the maximum value of one byte.
How do hex color codes work?
A code like #FF5733 is three hex bytes: red (FF=255), green (57=87), blue (33=51). Each pair ranges 00–FF, i.e. 0–255 intensity for that color channel.
What is #FF5733 in RGB?
#FF5733 in RGB is rgb(255, 87, 51) — a vivid orange-red.