HSL to HEX Converter

Enter an HSL color such as hsl(217, 80%, 51%) to get its HEX code.

Free · Runs in your browser · Your text is never uploaded

A color swatch shown in HEX, RGB and HSL formats

HSL to HEX

The tool converts hue, saturation and lightness to red, green and blue, then writes the three values as hex pairs. Hue units such as deg and turn are accepted.

Tip

To make a color lighter, raise the lightness; to mute it, lower the saturation.

Where this conversion helps

After adjusting hue, saturation and lightness in a design token, convert back to HEX for tools that expect it.

Common colors for reference

These values come from the CSS standard:

ColorHEXRGBHSL
Black#0000000, 0, 00, 0%, 0%
White#ffffff255, 255, 2550, 0%, 100%
Red#ff0000255, 0, 00, 100%, 50%
Lime#00ff000, 255, 0120, 100%, 50%
Blue#0000ff0, 0, 255240, 100%, 50%
Yellow#ffff00255, 255, 060, 100%, 50%
Gray#808080128, 128, 1280, 0%, 50%

Check readability

A color is only useful if text stays legible on it. The converter shows contrast ratios against white and black; WCAG AA needs 4.5:1 for normal text. For a full explanation of every notation, see HEX, RGB and HSL color codes explained.

Need more options? Open the full Color Converter.

Related guides

Frequently asked questions

How do I convert HSL to HEX?

Enter the HSL value and read the HEX line.

Do I need the % signs?

They are optional for saturation and lightness.