RGB to HSL
Convert your RGB color format to HSL format.
About this tool
Type or paste an RGB color, or choose one with the picker, and the converter shows it as HSL as you type, with a preview and every other format underneath, each with its own copy button. It reads colors written in any of the formats, and color names like “tomato”, too.
How to convert RGB to HSL
RGB already gives the red, green and blue channels, from 0 to 255. For HSL, divide each channel by 255 and take the largest and smallest of the three. The lightness is their average; the saturation is the gap between them, relative to the lightness; and the hue is an angle that depends on which channel is largest: red near 0, green near 120 and blue near 240.
The hue, saturation and lightness are rounded to whole numbers, so converting back can move a channel by one.
RGB to HSL examples
| Color | RGB | HSL |
|---|---|---|
| Sage green | rgb(168, 208, 141) |
hsl(96, 42%, 68%) |
| Red | rgb(255, 0, 0) |
hsl(0, 100%, 50%) |
| Tomato | rgb(255, 99, 71) |
hsl(9, 100%, 64%) |
| Gold | rgb(255, 215, 0) |
hsl(51, 100%, 50%) |
| Dodger blue | rgb(30, 144, 255) |
hsl(210, 100%, 56%) |
| Indigo | rgb(75, 0, 130) |
hsl(275, 100%, 25%) |
| Black | rgb(0, 0, 0) |
hsl(0, 0%, 0%) |
| White | rgb(255, 255, 255) |
hsl(0, 0%, 100%) |
What is RGB?
RGB writes a color as its red, green and blue channels, each from 0 to 255, the way screens make color by mixing light. rgb(0, 0, 0) is black and rgb(255, 255, 255) is white.
What is HSL?
HSL describes a color by its hue (0 to 360 degrees on the color wheel), saturation and lightness. It’s easy to adjust by hand: keep the hue and change the lightness to get lighter and darker shades of the same color. CSS accepts it directly.