Skip to content
hexcolorcodepicker.com

HSL to HEX Converter

HEX code

#3C83F6

rgb(60, 131, 246)

Enter hue, saturation, and lightness and get the HEX code instantly. Free HSL to HEX converter with sliders, live color preview, and one-click copy button.

What is HSL to HEX conversion?

HSL to HEX conversion turns a hue, a saturation, and a lightness into a six-digit HEX code. HSL is how designers describe a color — hue is the color family on a 0 to 360 degree wheel, saturation is how vivid it is, and lightness is how light or dark it is — and HEX is the code the web pastes into CSS. The converter takes your three HSL numbers and gives you the HEX code to use.

This is the step that turns a design decision into a usable code. A designer who says "a blue at 217 degrees, 91% saturation, 60% lightness" has described a color precisely, but CSS needs #3C83F6, and this tool is the bridge between the description and the code.

Three sliders, one live HEX code

Hue — rainbow slider217°

Marker at 217° — between cyan (180°) and blue (240°).

Saturation91%

Lightness60%

#3C83F6

Worked example: hsl(217, 91%, 60%) = #3C83F6

The HSL color hsl(217, 91%, 60%) converts to the HEX code #3C83F6. A hue of 217 degrees is blue, a saturation of 91% is very vivid, and a lightness of 60% is a little above halfway, and together they make a clear medium blue used for links and buttons. It is the reverse of the worked example on the HEX-to-HSL page — with the rounding shift §6 explains, so the code comes back as #3C83F6, not the original #3B82F6.

The conversion works through RGB in the middle: the HSL values first give RGB values of 60, 131, and 246, and those three numbers then become the hex pairs 3C, 83, and F6. The tool shows the RGB values beside the HEX code so you can check the middle step, and the swatch shows the color itself.

hsl(217, 91%, 60%)

input

rgb(60, 131, 246)

middle step

#3C83F6

3C · 83 · F6

Worked example: hsl(228, 69%, 55%) = #3D5DDB

The HSL color hsl(228, 69%, 55%) converts to the HEX code #3D5DDB. A hue of 228 degrees is a deeper blue than the last example, a saturation of 69% is strong but less vivid, and a lightness of 55% is just above halfway, and together they make a strong indigo blue. The rounded input gives #3D5DDB, a touch off the source example's #3b5bdb, because the HSL values were rounded — §6 explains the shift.

Compare it with the first example and the HSL numbers explain the difference. The hue moved 11 degrees toward violet, the saturation fell by 22 points, and the lightness fell by 5 points, so the color looks deeper, duller, and darker. Changing one HSL number at a time is how a designer explores shades without losing the color family.

hsl(217, 91%, 60%)

#3C83F6

hsl(228, 69%, 55%)

#3D5DDB

Hue +11° · saturation −22 points · lightness −5 points.

Worked example: hsl(11, 100%, 60%) = #FF5833

The HSL color hsl(11, 100%, 60%) converts to the HEX code #FF5833. A hue of 11 degrees sits just past red toward orange, a saturation of 100% is as vivid as a color can be, and a lightness of 60% is a little above halfway, and together they make a bright coral-orange. It is the reverse of the third worked example on the HEX-to-HSL page — §6 explains the rounding shift: the code comes back as #FF5833, not the original #FF5733.

The saturation of 100% is the number to notice: it means no gray is mixed in at all, so the color is as loud as its hue allows. If you lower the saturation to 50% and keep the hue and lightness, the same orange turns dusty and muted, and the HEX code changes with it. The sliders on this page let you feel that change directly.

Hue 11°

past red, toward orange

Saturation 100%

no gray at all

Lightness 60%

above halfway

Result: #FF5833 · rgb(255, 88, 51)

How the conversion works, in plain language

To convert HSL to HEX, first turn the HSL values into RGB, then write each RGB value as two hex digits. The hue decides which channel is largest and how the other two are mixed, the saturation decides how far apart the largest and smallest channels are, and the lightness decides their average. The result is three RGB numbers from 0 to 255, and each one becomes a hex pair by dividing by 16, as on the RGB-to-HEX page.

Take hsl(217, 91%, 60%) as the example: the lightness of 60% and the saturation of 91% give RGB values of 60, 131, and 246, and those become 3C, 83, and F6. The tool does the arithmetic in one step, but the two-stage path — HSL to RGB, then RGB to HEX — is the same path every converter follows, and the RGB values shown beside the output let you check it.

  1. 1. HSL in: hue 217°, saturation 91%, lightness 60%
  2. 2. RGB in the middle: 60, 131, 246
  3. 3. Each value ÷ 16: 60 → 3C · 131 → 83 · 246 → F6
  4. 4. Joined: #3C83F6

A note on rounding: converting back can shift channels by 1

HSL values are whole numbers, so converting rounded HSL back to HEX can shift two channels by 1. The exact HSL of #3B82F6 is about 217.2 degrees, 91.2% saturation, and 59.8% lightness, and this page takes the rounded 217, 91%, and 60% as its input. Converting those rounded values back gives rgb(60, 131, 246), which is #3C83F6 — one step different in the red and green channels from the original #3B82F6.

That shift is too small to see with the eye, and it is normal for every converter that works with whole numbers. It matters only if you need a bit-exact code, in which case you should start from the original HEX code rather than from rounded HSL values. The tool states the rounding plainly so the small difference is never a surprise.

Rounded HSL input

217°, 91%, 60%

#3C83F6

Original HEX

217.2°, 91.2%, 59.8%

#3B82F6

Red 59 → 60 and green 130 → 131 — rounding, not an error.

Building a palette from one hue

One hue with different saturation and lightness values makes a whole palette that always matches. Keep the hue at 217 degrees and use lightness 90% for a pale background tint, 60% for the main color, and 30% for a dark text or border color, and every shade belongs to the same blue family. Lower the saturation for muted backgrounds and raise it for accents, and the palette stays harmonious because the hue never moves.

This is the practical reason HSL exists: it turns palette-building into three separate decisions — which family, how vivid, how light — instead of guessing three channel numbers at once. The sliders on this page are the fastest way to explore those decisions, because each slider moves only one of the three.

Hue 217°, saturation 91% — five lightness steps, tap a swatch to copy it

90% pale tint · 60% main color · 30% dark text — one hue, one family.

All color tools

21 tools, one topic — see About Hex Color Code Picker for who built this site.

Frequently asked questions

Enter the hue from 0 to 360, the saturation from 0 to 100%, and the lightness from 0 to 100%, then copy the HEX code. Type the numbers or drag the sliders, and the HEX code updates live with a large swatch beside it.