Reading a hex code: #RRGGBB
Split the six digits into three pairs, each a hexadecimal value from 00 (0) to FF (255):
| Code | R | G | B | Color |
|---|---|---|---|---|
#FF0000 | 255 | 0 | 0 | Pure red |
#00FF00 | 0 | 255 | 0 | Pure green |
#0000FF | 0 | 0 | 255 | Pure blue |
#FF5733 | 255 | 87 | 51 | Warm orange-red |
#000000 / #FFFFFF | 0 / 255 | 0 / 255 | 0 / 255 | Black / White |
Mixing the three channels at 256 levels each yields 16.7 million possible colors (256³) — more than the human eye distinguishes on screen.
The 3-digit shorthand
When both digits in each pair match, you can write just three: #F53 expands to #FF5533, #FFF to white, #000 to black. Browsers handle the expansion automatically — it's pure convenience for stylesheets.
Hex with transparency
Modern CSS also accepts 8-digit hex (#RRGGBBAA), where the final pair sets opacity: #FF000080 is red at roughly 50% transparency. For older-browser support, rgba() remains the safer spelling.
❓ Hex Code FAQs
What is a hex color code?
A six-digit hexadecimal number (#RRGGBB) specifying a color's red, green and blue components — the standard color notation in web design.
How do you read a hex code?
Split into three pairs (RR GG BB), each 00–FF (0–255). #FF0000 is pure red; #000000 black; #FFFFFF white.
What is the 3-digit shorthand?
#F53 means #FF5533 — when each pair's digits match, three digits suffice. Browsers expand it automatically.
What about 8-digit hex?
The extra AA pair sets transparency: #FF000080 is red at ~50% opacity. Supported in modern browsers.
Related: What Is a QR Code? · What Is Base64? · Free Color Picker