Convert HEX to HSL
Converting hexadecimal (HEX) to Hue, Saturation, Lightness (HSL) 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 HEX → HSL 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 HEX to HSL
Take this real example — the color firebrick(#c2410c):
#c2410c → hsl(17.47, 88.35%, 40.39%)
- Convert the HEX color to RGB using the HEX → RGB method.
- Keep the three RGB channels (0–255) — this is the shared numeric base of every on-screen format.
- Convert RGB to HSL with the RGB → HSL method to finish.
HEX → RGB → HSL (RGB is the numeric bridge)
HEX to HSL conversion table
| Color | HEX | HSL |
|---|---|---|
| White | #ffffff | hsl(0, 0%, 100%) |
| Black | #000000 | hsl(0, 0%, 0%) |
| Red | #ff0000 | hsl(0, 100%, 50%) |
| Lime | #00ff00 | hsl(120, 100%, 50%) |
| Blue | #0000ff | hsl(240, 100%, 50%) |
| VersatilBox accent | #c2410c | hsl(17.47, 88.35%, 40.39%) |
| Tailwind blue-500 | #3b82f6 | hsl(217.22, 91.22%, 59.8%) |
| Tailwind emerald-500 | #10b981 | hsl(160.12, 84.08%, 39.41%) |
About these formats
HEX (hexadecimal). HEX is the web's native notation: a # followed by two digits per channel in base 16 (00–FF). Compact, unambiguous and supported everywhere, from CSS to design tools.
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.
Frequently asked questions
How do I convert HEX to HSL?
Convert the HEX color to RGB using the HEX → RGB method. Keep the three RGB channels (0–255) — this is the shared numeric base of every on-screen format. Convert RGB to HSL with the RGB → HSL method to finish. The converter above does it instantly, including the reverse direction.
What is HEX?
HEX — hexadecimal — is the web's native notation: a # followed by two digits per channel in base 16 (00–FF). Compact, unambiguous and supported everywhere, from CSS to design tools.
What is HSL used for?
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.
Is the HEX → HSL conversion exact?
Yes. HEX and RGB encode the identical numbers in different notations, so the conversion is exact in both directions with no rounding.
Why does the HSL 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.