Convert HSL to RGB
Converting Hue, Saturation, Lightness (HSL) to Red, Green, Blue (RGB) is a precise, rule-based operation — both formats describe the same color with different numbers. Whether you are tuning a CSS custom property, matching a brand color across design tools, or preparing values for print, this page gives you an interactive converter, the exact HSL → RGB method, a worked example, a quick-reference table and the details that matter (rounding, gamut and print caveats).
From
To
—
—
—
Live preview
How to convert HSL to RGB
Take this real example — the color firebrick(#c2410c):
hsl(17.47, 88.35%, 40.39%) → rgb(194, 65, 12)
- Normalize: H to 0–360°, S and L to 0–1.
- Compute the chroma C = (1 − |2L − 1|)·S and the intermediate value X = C·(1 − |((H/60) mod 2) − 1|), then m = L − C/2.
- Pick (R′, G′, B′) from the hue sector table (60° each: red→yellow→green→cyan→blue→magenta), add m to every channel and scale to 0–255.
C = (1 − |2L − 1|)·S, X = C·(1 − |(H/60 mod 2) − 1|), m = L − C/2
HSL to RGB conversion table
| Color | HSL | RGB |
|---|---|---|
| White | hsl(0, 0%, 100%) | rgb(255, 255, 255) |
| Black | hsl(0, 0%, 0%) | rgb(0, 0, 0) |
| Red | hsl(0, 100%, 50%) | rgb(255, 0, 0) |
| Lime | hsl(120, 100%, 50%) | rgb(0, 255, 0) |
| Blue | hsl(240, 100%, 50%) | rgb(0, 0, 255) |
| VersatilBox accent | hsl(17.47, 88.35%, 40.39%) | rgb(194, 65, 12) |
| Tailwind blue-500 | hsl(217.22, 91.22%, 59.8%) | rgb(59, 130, 246) |
| Tailwind emerald-500 | hsl(160.12, 84.08%, 39.41%) | rgb(16, 185, 129) |
About these formats
HSL (Hue, Saturation, Lightness). HSL is a cylindrical way of thinking about RGB that matches how humans adjust color: pick a hue angle, then dial saturation and lightness. Defined by CSS Color 4.
RGB (Red, Green, Blue). RGB is the additive model screens use: every color is a mix of red, green and blue light from 0 to 255 per channel. It is the numeric base all on-screen conversions pass through.
Frequently asked questions
How do I convert HSL to RGB?
Normalize: H to 0–360°, S and L to 0–1. Compute the chroma C = (1 − |2L − 1|)·S and the intermediate value X = C·(1 − |((H/60) mod 2) − 1|), then m = L − C/2. Pick (R′, G′, B′) from the hue sector table (60° each: red→yellow→green→cyan→blue→magenta), add m to every channel and scale to 0–255. The converter above does it instantly, including the reverse direction.
What is HSL?
HSL — Hue, Saturation, Lightness — is a cylindrical way of thinking about RGB that matches how humans adjust color: pick a hue angle, then dial saturation and lightness. Defined by CSS Color 4.
What is RGB used for?
RGB (Red, Green, Blue) is the additive model screens use: every color is a mix of red, green and blue light from 0 to 255 per channel. It is the numeric base all on-screen conversions pass through.
Is the HSL → RGB conversion exact?
Yes. The formulas are deterministic and both formats store the same information for on-screen color; values are rounded only for display.
Why does the RGB value look different in other tools?
Small differences come from rounding (how many decimals are kept) and from out-of-gamut handling. This site follows the CSS Color 4 algorithms and shows OKLCH with 3 decimals, the same convention used by browsers and mainstream design tools.