HSL to HEX converter

Paste any HSL color and get its HEX value instantly, together with every other format: HEX, RGB, HSL, HWB, CMYK and OKLCH. Free, and it runs in your browser.

  • Free
  • No sign-up
  • Runs in your browser
hsl-to-hex

Fill in the values above to see the result.

100% private — the calculation is done in your browser and nothing is sent to any server.

How it works

Enter the color

Type or paste a HSL code, or pick a color with the color picker.

Read the HEX value

Every format updates as you type and shows a live preview of the color.

Copy it

Use the copy button next to the format you need.

How to convert HSL to HEX

To convert HSL to HEX, enter your HSL color in the box above and read the HEX value next to it. For example, hsl(262, 83%, 58%) is #7C3BED. The result updates as you type, and every other format (HEX, RGB, HSL, CMYK and more) is shown at the same time.

What HSL and HEX mean

HSL describes a color as hue (0 to 360 degrees around the color wheel), saturation (0 to 100 percent) and lightness (0 to 100 percent). It is easier to reason about than RGB: keep the hue and change the lightness to get lighter or darker shades of the same color.

A HEX color is a six-digit hexadecimal code with a # in front: two digits each for red, green and blue, from 00 to FF. In #3B82F6, red is 3B, green is 82 and blue is F6. A three-digit shorthand such as #38F repeats each digit, and eight digits add opacity at the end.

Convert HSL to HEX by hand

Here is the calculation for hsl(262, 83%, 58%), step by step:

  1. Start from hue 262°, saturation 83% and lightness 58%.
  2. Use them to find the chroma (the color intensity) and place the hue on the color wheel to get the three channel values: red 124, green 59, blue 237.
  3. Convert each channel to two hexadecimal digits: #7C3BED.

HSL to HEX table of common colors

HSL to HEX
ColorHSLHEX
Blackhsl(0, 0%, 0%)#000000
Whitehsl(0, 0%, 100%)#FFFFFF
Redhsl(0, 100%, 50%)#FF0000
Limehsl(120, 100%, 50%)#00FF00
Bluehsl(240, 100%, 50%)#0000FF
Yellowhsl(60, 100%, 50%)#FFFF00
Cyanhsl(180, 100%, 50%)#00FFFF
Magentahsl(300, 100%, 50%)#FF00FF
Grayhsl(0, 0%, 50%)#808080
Orangehsl(39, 100%, 50%)#FFA500
Purplehsl(300, 100%, 25%)#800080
Pinkhsl(350, 100%, 88%)#FFC0CB
Brownhsl(0, 59%, 41%)#A52A2A
Navyhsl(240, 100%, 25%)#000080
Tealhsl(180, 100%, 25%)#008080
Coralhsl(16, 100%, 66%)#FF7F50

When to use HSL and when HEX

HSL is best when you want to adjust a color by eye or in code: raise the lightness for a hover state, lower the saturation for a muted variant. HEX is the most compact way to write a color in CSS and design tools, so it is the code most people copy and share.

Good to know

  • Shorthand HEX codes such as #38F expand to #3388FF, and eight-digit codes carry an opacity value at the end.
  • Values are rounded to whole numbers for display; the converter keeps more precision internally.
  • The color picker lets you pick a color by eye when you do not have its code.
  • Colors displayed on screen depend on your monitor's calibration, so the same code can look slightly different on different devices.

Frequently asked questions

How do I convert HSL to HEX?
Enter the HSL color in the converter at the top of this page and read the HEX value. For hsl(262, 83%, 58%) the result is #7C3BED.
What is HSL?
HSL describes a color as hue (0 to 360 degrees around the color wheel), saturation (0 to 100 percent) and lightness (0 to 100 percent). It is easier to reason about than RGB: keep the hue and change the lightness to get lighter or darker shades of the same color.
What is HEX?
A HEX color is a six-digit hexadecimal code with a # in front: two digits each for red, green and blue, from 00 to FF. In #3B82F6, red is 3B, green is 82 and blue is F6. A three-digit shorthand such as #38F repeats each digit, and eight digits add opacity at the end.
Can I convert to other formats at the same time?
Yes. The converter shows HEX, RGB, HSL, HWB, CMYK and OKLCH together, and you can copy any of them.
Is the conversion exact?
The result is mathematically derived from the RGB values and rounded for display. CMYK in particular is an approximation, because printers and inks vary.
Is it free and private?
Yes. It is free, needs no sign-up and works in your browser, so the colors you type are never sent to a server.