RGB to HSL

Turn any rgb() value into HSL instantly, ready to tune by hue, saturation and lightness.

1
Step one — Paste your rgb() value
Also accepts bare numbers, like 79, 70, 229.
2
Step two — Your HSL color
3
Step three — The same color, every format

Steps to convert RGB to HSL

  1. Paste your rgb() value, or the three 0 to 255 numbers, into the field.
  2. Read the hsl() result, shown as hue, saturation and lightness.
  3. Use the wheel and bars to see where the color sits, then click to copy.
  4. Carry on editing in the HSL picker if you want to adjust it.

Meaning of the HSL values

RGB describes a color as three light channels; HSL re-expresses the same color as three numbers you can reason about. For rgb(30, 144, 255) the result is hsl(210, 100%, 56%):

PartValueMeans
Hue210Angle on the wheel, here a blue
Saturation100%Fully vivid, no gray
Lightness56%Just above mid, a clean bright blue

How RGB to HSL conversion works

The three channels are first scaled to 0 to 1, then recombined. Hue comes from which channel is largest and by how much, saturation from the gap between the highest and lowest channel, and lightness from their average. It is the same color throughout, just measured a different way, so the trip is reversible with no loss beyond rounding.

Why HSL is easier to work with than RGB

Nudging a color in RGB means juggling three numbers at once, and that is exactly the friction HSL removes. To darken a color you lower one value, lightness, instead of guessing how to drop red, green and blue together. For building UI states and tints by hand, reasoning in hue, saturation and lightness is simply more intuitive than thinking in light channels.

What RGB to HSL is used for

  • Turning a color sampled in RGB into a form you can lighten or darken cleanly.
  • Building hover and active states by shifting only the lightness.
  • Muting or boosting a color through its saturation without touching the hue.
  • Generating a matching set from one color with the Scheme Generator.
Worked example: rgb(30, 144, 255) becomes hsl(210, 100%, 56%). Reverse it with HSL to RGB.
Is the conversion exact?

Yes, aside from rounding the HSL numbers to whole values for readability.

Why is my saturation 0% on a gray?

When red, green and blue are equal the color has no hue, so saturation is zero and only lightness varies.

How do I lighten the color after converting?

Keep the hue and saturation and raise the lightness percentage; lowering it darkens the color instead.

Is HSL the same as HSV?

No. HSL uses lightness, where 100% is white, while HSV uses value, where 100% is the most vivid hue.

You might also like