Skip to the color picker
PickShade

RGB to HSL converter

Paste a RGB value, get HSL instantly. Any other format works too.

Read as RGB

HSL valuehsl(10.59 100% 60%)
HSL to RGB

Every other format

RGB to HSL examples

ColorRGBHSL
rgb(255 0 0)hsl(0 100% 50%)
rgb(0 255 0)hsl(120 100% 50%)
rgb(0 0 255)hsl(240 100% 50%)
rgb(255 255 255)hsl(0 0% 100%)
rgb(0 0 0)hsl(0 0% 0%)
rgb(128 128 128)hsl(0 0% 50.2%)
rgb(255 87 51)hsl(10.59 100% 60%)
rgb(59 130 246)hsl(217.22 91.22% 59.8%)
rgb(16 185 129)hsl(160.12 84.08% 39.41%)
rgb(245 158 11)hsl(37.69 92.13% 50.2%)
rgb(139 92 246)hsl(258.31 89.53% 66.27%)
rgb(236 72 153)hsl(330.37 81.19% 60.39%)

About RGB and HSL

RGB sets red, green and blue from 0 to 255. It describes how a screen mixes light and is written as rgb(255 87 51) in modern CSS.

HSL describes hue in degrees, saturation and lightness in percent. It is easy to read, but its lightness is not perceptually even: yellow at 50% looks much lighter than blue at 50%.

How the conversion works

We read the RGB value, convert it to CIE XYZ with the matrices from the CSS Color 4 specification and then into HSL. Values outside the target gamut are mapped by the CSS Color 4 algorithm, which keeps lightness and hue and reduces chroma.

Questions and answers

How do I convert RGB to HSL?

Paste or type a RGB value into the field above. PickShade converts it with the CSS Color 4 formulas as you type, and one click copies the HSL value.

Is the RGB to HSL conversion exact?

The math is exact and the result is rounded only for display, with enough digits to convert back to the same color. If the color does not fit the target gamut, PickShade warns you and shows the nearest color that fits.

Can I get other formats at the same time?

Yes. Every other format, including OKLCH, Display P3, Tailwind, SwiftUI, Flutter and Android, is listed below the result and copies with one click.

Is this converter free?

Yes. It is free, needs no sign-up and runs entirely in your browser.