RGB to HSL converter

To convert RGB to HSL, divide each channel by 255, take lightness as the average of the largest and smallest channel, then work out saturation and hue from the gap between them: rgb(37, 99, 235) is hsl(221, 83%, 53%).

Paste an rgb() or rgba() value from your CSS or a browser inspector and get the matching HSL or HSLA value instantly, with alpha preserved.

How to convert RGB to HSL

Start with rgb(37, 99, 235). Divide each channel by 255 to get 0.145, 0.388 and 0.922. The largest is blue, so the hue falls in the blue range: 221°. Lightness is (0.922 + 0.145) ÷ 2 = 0.533, saturation is 0.832, and the full result is hsl(221, 83%, 53%).

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

Common RGB to HSL values

ColorRGBHEXHSL
Whitergb(255, 255, 255)#ffffffhsl(0, 0%, 100%)
Blackrgb(0, 0, 0)#000000hsl(0, 0%, 0%)
Bluergb(37, 99, 235)#2563ebhsl(221, 83%, 53%)
Redrgb(239, 68, 68)#ef4444hsl(0, 84%, 60%)
Greenrgb(34, 197, 94)#22c55ehsl(142, 71%, 45%)
50% transparent bluergba(37, 99, 235, 0.5)#2563eb80hsla(221, 83%, 53%, 0.5)

RGB to HSL converter FAQs

How do I convert RGB to HSL?

Divide each RGB channel by 255, then find the maximum and minimum. Lightness is (max + min) ÷ 2, saturation comes from the difference between them, and hue depends on which channel is largest. rgb(37, 99, 235) becomes hsl(221, 83%, 53%).

What is rgb(37, 99, 235) in HSL?

rgb(37, 99, 235) is hsl(221, 83%, 53%). The blue channel is the highest, so the hue sits in the blue range at 221°, the color is highly saturated at 83%, and its lightness is just over half at 53%.

Does this converter support rgba() transparency?

Yes. Paste rgba(37, 99, 235, 0.5) and the converter returns hsla(221, 83%, 53%, 0.5) alongside the matching HEX code, so the alpha value is kept in every output format.

Related color tools

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools