Color Codes Explained: HEX, RGB, HSL & CMYK Conversion Guide 2026

Published April 2, 2026

Colors are everywhere on the web. But have you ever wondered what #6366f1 or rgb(99, 102, 241) actually means? Understanding color codes is essential for web design, graphic design, and digital art.

In this guide, we'll break down the four major color formats — HEX, RGB, HSL, and CMYK — and show you how to convert between them using our free Color Picker tool.

1. HEX Color Codes

HEX (hexadecimal) is the most common color format on the web. It's a 6-digit code that represents the red, green, and blue components of a color.

Format: #RRGGBB

Each pair represents a color channel from 00 (0) to FF (255) in hexadecimal:

3-Digit Shorthand

When both digits of each pair are the same, you can shorten the code: #FFF = #FFFFFF, #F00 = #FF0000.

2. RGB Color Model

RGB stands for Red, Green, Blue. It's an additive color model — adding all three at full intensity produces white.

Format: rgb(red, green, blue) where each value is 0-255.

RGB to HEX Conversion

Converting is straightforward: each decimal value (0-255) becomes a 2-digit hex value.

RGB(99, 102, 241) → HEX:
  99  = 63 → #63
  102 = 66 → #66
  241 = F1 → #F1
  Result: #6366F1

3. HSL Color Model

HSL (Hue, Saturation, Lightness) is more intuitive for designers because it describes colors the way humans think about them.

Why HSL is Better for Design

Want a lighter version of a color? Just increase the lightness. Want it more muted? Decrease saturation. With HEX or RGB, you'd need to recalculate all three channels.

4. CMYK Color Model

CMYK (Cyan, Magenta, Yellow, Key/Black) is used in print. It's a subtractive model — ink absorbs light, so adding all colors produces black.

Important: Colors look different on screen (RGB) vs. print (CMYK). Always convert and test before sending to print!

Quick Reference: Popular Web Colors

Color HEX RGB HSL
Red#EF4444239, 68, 680°, 84%, 60%
Orange#F97316249, 115, 2225°, 92%, 53%
Green#22C55E34, 197, 94142°, 71%, 45%
Blue#3B82F659, 130, 246217°, 91%, 60%
Purple#8B5CF6139, 92, 246258°, 90%, 66%
Pink#EC4899236, 72, 153330°, 81%, 60%

🎨 Try the Color Picker

Convert between HEX, RGB, and HSL instantly

Open Color Picker →