How to use Hex to HSL converter
- Type or paste a hex color code, with or without the leading #.
- See the HSL value and the color swatch update as you type.
- Copy the hsl() value, or copy any of the other formats listed below it.
Features
- Accepts 3-digit (#RGB), 6-digit (#RRGGBB) and 8-digit (#RRGGBBAA) hex codes
- Shows hue in degrees and saturation and lightness in percent
- Also lists HEX, RGB and CMYK, each with a copy button
- Live color swatch and clear error message for invalid codes
- Runs in your browser with no upload
Examples
| Input | Result |
|---|---|
| #4F33E8 | hsl(249, 80%, 55%) |
| #F33 | hsl(0, 100%, 60%) |
| #22C55E | hsl(142, 71%, 45%) |
Limitations
- HSL values are rounded to whole numbers, so converting back can move a channel by a few units: #4F33E8 becomes hsl(249, 80%, 55%), which converts back to #4C30E8. Keep the original hex if you need the exact color. CMYK is a simple conversion without an ICC profile.
Learn more
HSL describes a color the way people tend to think about it: which color family (hue), how vivid it is (saturation) and how light or dark it is (lightness). That makes it handy for design work, because you can build a hover state by lowering lightness by ten points, or a muted version by lowering saturation, without touching the other values.
Hex is a compact way to write the same sRGB color, so converting is a matter of arithmetic. Each channel is divided by 255, lightness is the average of the largest and smallest channel, saturation compares their difference with the lightness, and hue is an angle chosen by which channel is largest. CSS accepts hsl() directly, and the method follows the W3C CSS Color specification.
Frequently asked questions
How do I convert hex to HSL?
Split the hex code into red, green and blue, turn each pair into a number from 0 to 255, then compute hue, saturation and lightness from the largest and smallest channel. The tool does all of this as you type.
What do the three HSL numbers mean?
Hue is the color angle on the wheel from 0 to 360 degrees, saturation is how intense the color is from 0 to 100 percent, and lightness runs from black at 0 percent to white at 100 percent.
Why does converting back not give the same hex code?
HSL is shown in whole numbers, which loses a little precision. The difference is small but can change one or two hex digits.
Does it accept shorthand codes like #F00?
Yes. A 3-digit code repeats each digit, so #F00 means #FF0000 and gives hsl(0, 100%, 50%).
Sources
Last reviewed: September 30, 2026