Skip to content
toolgrid

No tool found. Try another word.

RGB to HSL Converter

Convert RGB values to HSL (hue, saturation, lightness) for CSS, plus hex, HWB, OKLCH and CMYK, as you type.

  • hsl
  • hex
  • rgb
  • hwb
  • oklch
  • cmyk

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the RGB to HSL Converter

  1. 1 Enter the red, green and blue values or pick a color.
  2. 2 Read the hsl() value and the hue, saturation and lightness.
  3. 3 Copy the format you need.

About the RGB to HSL Converter

HSL describes a color the way people think about it: the hue is the angle on the color wheel (0° red, 120° green, 240° blue), saturation is how colorful it is, and lightness runs from black (0%) through the pure color (50%) to white (100%).

The conversion uses the standard formula from the CSS specification: the largest and smallest of R, G and B give the lightness, their difference gives the saturation, and which channel is largest decides the hue.

HSL makes it easy to create variations, such as a lighter hover color, by changing one number. For steps that look evenly spaced to the eye, OKLCH is better, and it is shown below as well.

Frequently asked questions

What are the ranges of HSL?

Hue 0–360 degrees, saturation and lightness 0–100%.

Why is the hue 0 for gray?

Grays have no hue: with saturation 0 the hue doesn’t matter, so it is shown as 0.

Is HSL the same as HSB or HSV?

No. HSV/HSB uses brightness instead of lightness; a pure color is 100% brightness but 50% lightness.

Can I use the result directly in CSS?

Yes, hsl() and hsla() work in every browser.