You've seen them everywhere: #FF0000, #3B82F6, #1A1A2E. These are hex color codes — the standard language for expressing color in web design, CSS, design tools like Figma, and most graphics software. If you've ever wondered what those letters and numbers actually mean, this guide explains it all from scratch.

What does "hex" mean?

Hex is short for hexadecimal — a base-16 number system. Regular numbers are base-10 (digits 0–9). Hexadecimal adds six more digits using letters: A, B, C, D, E, F — where A=10, B=11, C=12, D=13, E=14, F=15.

This means a single hex digit can represent 16 values, and two hex digits together can represent 16 × 16 = 256 values (0–255). That's exactly the range needed for a single color channel.

Anatomy of a hex color code

#FF6B6B
# Prefix
FF Red · 255
6B Green · 107
6B Blue · 107

Every hex color has exactly 4 components:

Together, those three pairs encode 16,777,216 possible colors — the full RGB color space at 8 bits per channel.

Reference colors — memorize these landmarks

ColorHexRGBWhat to notice
Pure Red#FF0000rgb(255,0,0)Full Red, zero Green+Blue
Pure Green#00FF00rgb(0,255,0)Full Green, zero others
Pure Blue#0000FFrgb(0,0,255)Full Blue, zero others
White#FFFFFFrgb(255,255,255)All channels max
Black#000000rgb(0,0,0)All channels zero
Mid Gray#808080rgb(128,128,128)All channels equal (80 hex = 128)
Coral#FF6B6Brgb(255,107,107)Full red, moderate green+blue
Sky Blue#0EA5E9rgb(14,165,233)Very low red, high green+blue
💡 Quick reading tip
To get a rough sense of a hex color: look at the first pair for redness, the second for greenness, the third for blueness. #FF0000 = all red. #00FFFF = no red + full green+blue = cyan. #FFFFFF = everything at max = white.

How to read hex in your head

You don't need to calculate exact decimal values to read hex colors. Here's a faster mental model:

So #FF8000 reads as: full red + half green + no blue = orange. No calculator needed.

The 3-digit shorthand

When each of the three color pairs has both identical digits (like FF, AA, or 33), you can write just one digit per channel. The browser doubles it automatically.

ShortFull hexColor
#FFF#FFFFFFWhite
#000#000000Black
#F00#FF0000Red
#09C#0099CCSky Blue
#FAC#FFAACCPink

You can't shorten #FF6B6B because the middle pair (6B) does not repeat — 6 ≠ B.

Hex with transparency — the 8-digit format

Modern CSS supports an optional fourth pair of digits for the alpha (opacity) channel:

ℹ Transparency shortcut
For common opacity levels in 8-digit hex: FF=100%, CC=80%, 99=60%, 66=40%, 33=20%, 00=0%.

Hex in CSS — how to actually use it

Hex codes work anywhere a CSS color value is accepted:

color: #FF6B6B; — text color
background: #1A1A2E; — background
border: 2px solid #6366f1; — borders
box-shadow: 0 4px 20px #6366f140; — shadow with opacity (8-digit hex)

When you need a semi-transparent version of a hex color without the 8-digit format, convert to RGBA: our hex to RGB converter shows the RGBA value for any hex code instantly.

Popular colors and their hex codes

#6366F1
Indigo
#06B6D4
Cyan
#F43F5E
Rose Red
#F59E0B
Amber
#10B981
Emerald
#8B5CF6
Violet

Convert any hex color instantly

Paste a hex code and get RGB, RGBA, HSL, HSV — all at once, with one-click copy.

Open the Converter →

Related Articles

The Complete Guide to Hex to RGB Conversion — the full formula, worked examples, and code in JavaScript, Python, and CSS.

Hex to RGB in JavaScript — 5 Methods — copy-ready code for every use case.