Converters

HEX to HSL Converter

Convert any HEX color into HSL — hue angle, saturation percentage and lightness percentage. HSL is often easier to work with than HEX when you're adjusting a single attribute (like darkening a hover state) or generating related colors programmatically.

HEX input

Try an example:

#267D70
Live preview

HSL output

170°
53%
32%

CSS value

hsl(170, 53%, 32%)

How to convert HEX to HSL — the exact method

  1. Convert HEX to RGB (see the HEX → RGB Converter).
  2. Apply the standard RGB-to-HSL formula:
    • Hue — measured in degrees around the color wheel.
    • Saturation — how pure the color is (0% = gray, 100% = fully saturated).
    • Lightness — how light or dark (0% = black, 100% = white).

Example: #267D70 → RGB(38, 125, 112) → HSL(170°, 53%, 32%).

Quick HEX to HSL reference chart

ColorHEXHSL
Red#FF0000hsl(0, 100%, 50%)
Yellow#FFFF00hsl(60, 100%, 50%)
Green#00FF00hsl(120, 100%, 50%)
Cyan#00FFFFhsl(180, 100%, 50%)
Blue#0000FFhsl(240, 100%, 50%)
Magenta#FF00FFhsl(300, 100%, 50%)
Black#000000hsl(0, 0%, 0%)
White#FFFFFFhsl(0, 0%, 100%)
Teal (brand)#267D70hsl(170, 53%, 32%)

Why HSL is useful

  • Consistent lightness — HSL makes it trivial to create a hover or pressed state by changing only lightness.
  • Programmatic palette generation — hue rotation gives reliable complementary and triadic colors, which is why COOLOUR's palette tools use HSL under the hood.
  • Readable in design tokens — HSL values reveal intent (e.g. "brand teal at L=32%") better than raw HEX does.
  • Modern CSS support — hsl() and hsl() with space-separated syntax (hsl(170 53% 32%)) are supported across browsers.

FAQ

How do I convert HEX to HSL?
First convert HEX to RGB, then apply the standard RGB-to-HSL formula from the CSS Color Module Level 3.
What does hue mean in HSL?
Hue is the color angle on the color wheel, 0°–360°. 0° red, 60° yellow, 120° green, 180° cyan, 240° blue, 300° magenta.
Is HEX to HSL conversion lossless?
Yes for practical purposes. HSL is computed from the exact RGB values of the HEX code, and round-tripping reproduces the original HEX.
Can I use hsl() in CSS?
Yes. hsl() has been supported in every major browser for years.
Does this tool support 3-digit HEX?
Yes. Short codes like #FC0 are expanded to #FFCC00 first, then converted.
Is the tool free and private?
Yes. Free, no signup, all processing in your browser.

Related tools

Related articles