HEX to HSL converter

To convert HEX to HSL, turn the HEX code into RGB, then work out hue (0–360°), saturation and lightness (0–100%): #3B82F6 = hsl(217, 91%, 60%). Paste any HEX code below to convert it instantly.

Paste a HEX code and get the matching HSL or HSLA value instantly. The live preview keeps alpha, and every format is ready to copy into CSS.

How to convert HEX to HSL

Take #2563eb and read the three pairs: 25, 63 and eb. They become 37, 99 and 235, or 0.145, 0.388 and 0.922 once divided by 255. Lightness is (0.922 + 0.145) ÷ 2 = 0.533, saturation works out to 0.832, and hue is 221°. The result is hsl(221, 83%, 53%).

Rotate the hue 180° to get the complement in the color wheel tool; change lightness in steps with the color shades generator.

HEX#2563eb
RGBrgb(37, 99, 235)
HSLhsl(221, 83%, 53%)

Common HEX to HSL values

ColorHEXRGBHSL
White#ffffffrgb(255, 255, 255)hsl(0, 0%, 100%)
Black#000000rgb(0, 0, 0)hsl(0, 0%, 0%)
Blue#2563ebrgb(37, 99, 235)hsl(221, 83%, 53%)
Red#ef4444rgb(239, 68, 68)hsl(0, 84%, 60%)
Green#22c55ergb(34, 197, 94)hsl(142, 71%, 45%)
50% transparent blue#2563eb80rgba(37, 99, 235, 0.502)hsla(221, 83%, 53%, 0.502)

HEX to HSL converter FAQs

How do I convert HEX to HSL?

Split the HEX code into red, green and blue, divide each channel by 255, then find the maximum and minimum. Lightness is (max + min) ÷ 2. For #2563eb the channels are 37, 99 and 235, which gives hsl(221, 83%, 53%).

What is the HSL value of #2563eb?

#2563eb is hsl(221, 83%, 53%). Hue 221 is the blue-violet angle, saturation 83% describes how vivid the color is, and lightness 53% places it just above the middle of the black-to-white scale.

How do I add transparency to an HSL color?

Use hsla() and add alpha as a decimal from 0 to 1. The same blue at 50% opacity is hsla(221, 83%, 53%, 0.5). This converter keeps the alpha when you paste an eight-digit HEX such as #2563eb80.

Related color tools

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools