HSL to HEX converter

To convert HSL to HEX, turn hue, saturation and lightness into red, green and blue (0–255), then write each channel as two hex digits: hsl(221, 83%, 53%) is #2463eb. Paste any hsl() or hsla() value below to get the HEX code.

How to convert HSL to HEX

For hsl(221, 83%, 53%), converting hue, saturation and lightness gives rgb(36, 99, 235). Rounding and writing each channel as two hex digits gives 24, 63 and eb, so the result is #2463eb, not #2563eb. HSL percentages are rounded, so a round trip can shift a channel by 1. For alpha, hsla(221, 83%, 53%, 0.5) uses 0.5 × 255 = 128, which is 80 in hex, producing the eight-digit value #2463eb80.

HEX#2463eb
RGBrgb(36, 99, 235)
HSLhsl(221, 83%, 53%)

Common HSL to HEX values

ColorHSLHEXRGB
Whitehsl(0, 0%, 100%)#ffffffrgb(255, 255, 255)
Blackhsl(0, 0%, 0%)#000000rgb(0, 0, 0)
Redhsl(0, 84%, 60%)#ef4343rgb(239, 67, 67)
Bluehsl(221, 83%, 53%)#2463ebrgb(36, 99, 235)
Greenhsl(142, 71%, 45%)#21c45drgb(33, 196, 93)
50% transparent bluehsla(221, 83%, 53%, 0.5)#2463eb80rgba(36, 99, 235, 0.5)

HSL to HEX converter FAQs

How do I convert HSL to HEX?

Convert HSL to HEX by turning hue, saturation and lightness into red, green and blue channels from 0 to 255, rounding each channel and writing it as two hexadecimal digits. For example, hsl(221, 83%, 53%) becomes rgb(36, 99, 235) and then #2463eb.

How do I convert hsla() with transparency to HEX?

Convert an hsla() color to eight-digit HEX by converting its HSL channels as usual, multiplying alpha by 255 and appending the rounded result as two hexadecimal digits. An alpha of 0.5 becomes 128, or 80 in HEX, so hsla(221, 83%, 53%, 0.5) becomes #2463eb80.

Why does converting HEX to HSL and back change my color slightly?

A HEX to HSL to HEX round trip can change a channel by 1 because HSL percentages are rounded for display, so converting back may round an RGB channel to a neighboring integer. The colors are visually almost identical; use the original HEX code when you need an exact value.

Related color tools

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools