U.UtilityApp
🔄 ConvertersFree · No signup

HEX to HSL Converter

Convert HEX colors into HSL (hue, saturation, lightness) for easier theming.

What you can type in the HEX box

The default colour #4f46e5 converts to rgb(79, 70, 229) and hsl(243, 75%, 59%). The HEX box accepts:

  • six digits, with or without the #;
  • three-digit shorthand, where each digit is doubled, so #f0f means #ff00ff and gives hsl(300, 100%, 50%);
  • upper or lower case, which give the same result.

Codes with an alpha channel, the four- and eight-digit forms like #4f46e5cc, are not accepted. You'll see a note asking for a 3- or 6-digit code, and the RGB and HSL boxes keep showing the default colour's values rather than yours, so don't copy them until the note disappears.

Why the trip back is close but not exact

The HSL values are rounded to whole numbers. Converting hsl(243, 75%, 59%) back gives rgb(80, 72, 229), a step away from the original rgb(79, 70, 229), which is #5048e5 instead of #4f46e5. You won't see the difference, but a design token or a test that compares exact codes will.

Rounding also merges near neighbours. #7f7f7f and #808080 both come out as hsl(0, 0%, 50%). Keep the HEX code as the source of truth and treat the HSL figure as a handle for adjusting the colour.

Making lighter and darker shades

HSL is handy for theming because the hue and saturation stay put while you move the lightness. Taking 59% up or down by 10 points gives hover and border shades that clearly belong to the same colour:

HSLHEX
hsl(243, 75%, 69%)#7b75eb
hsl(243, 75%, 59%)#4f46e5
hsl(243, 75%, 49%)#291fdb

The middle row is your original code. Paste the other two into the HEX box and they come back with the same hue and saturation, so the set stays consistent.

Edge cases in the output

  • Greys, black and white have a saturation of 0%, and their hue is shown as 0. The hue has no meaning for them, so any value would give the same colour.
  • Reds just short of a full turn can round up to 360: #ff0001 gives hsl(360, 100%, 50%). CSS treats 360 the same as 0.
  • The copied value uses the comma syntax, hsl(243, 75%, 59%), which every current browser reads.

Frequently asked questions

Is HSL the same as the HSB or HSV values in design apps?+

No. They share the hue, but saturation and the third value are calculated differently. #4f46e5 is HSL 75% saturation and 59% lightness, but roughly 69% saturation and 90% brightness in HSB.

Can I type a colour name like red?+

No. The HEX box only accepts hexadecimal codes. Use the colour picker beside it to choose a colour visually, and the codes update from your pick.

Does the HEX copy button tidy up my code?+

No. It copies the HEX box exactly as you typed it, so a three-digit or upper-case code stays that way. Picking a colour or editing an RGB box rewrites the HEX box as six lower-case digits.

Embed this tool on your website

Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.

<iframe src="https://utilityapp.lat/embed/convert/hex-to-hsl" title="HEX to HSL Converter" width="100%" height="520" style="border:0;max-width:760px" loading="lazy"></iframe>
<p style="font-size:13px"><a href="https://utilityapp.lat/convert/hex-to-hsl">HEX to HSL Converter</a> by UtilityApp</p>