HEX, RGB and HSL – what they mean
All three describe the same colors, just in different notations:
- HEX – a six-digit hexadecimal code like
#3b5bdb, where each pair is the red, green and blue value. Compact and ubiquitous in CSS and design tools. - RGB – the same red/green/blue channels written as three numbers from 0 to 255, e.g.
rgb(59, 91, 219). Easy to reason about in code. - HSL – hue (0–360°), saturation (%) and lightness (%), e.g.
hsl(228, 69%, 55%). The most intuitive when you want to nudge a color lighter, darker or less saturated.
Because HSL separates “which colour" (hue) from “how light" (lightness), it is great for building tints and shades. Once you have a value here, check whether it is legible on your background with the color contrast checker, or build a whole scheme with its harmony generator.
How to use it
- Pick a color with the swatch, or type a value into HEX, RGB or HSL.
- The other two formats and the preview update instantly.
- Click Copy next to the format you need.
Everything is calculated locally in your browser – no color data is uploaded.
FAQ
HEX vs RGB vs HSL?
HEX and RGB are two notations for the same red/green/blue values. HSL instead uses hue, saturation and lightness, which is easier for adjusting a color.
Can I type a shorthand hex like #abc?
Yes. Three-digit hex codes are expanded automatically (#abc → #aabbcc).
Is my color data private?
Yes – all conversion happens in your browser. Nothing is sent to a server.