RGB to HSL Color Converter
Enter the RGB channels (red, green, blue, each 0-255) and this tool converts your color to HSL format (0-360 degree hue, percentage saturation, percentage lightness). Handy for design, CSS, and graphics work that needs a quick color conversion.

rgb(52, 152, 219)The hue (H) value shows your color's position on the color wheel, saturation (S) shows how vivid or muted it is, and lightness (L) shows how close it is to black or white. Together, these three values can be used directly in CSS as hsl(H, S%, L%).
How to interpret the result
The hue (H) value shows your color's position on the color wheel, saturation (S) shows how vivid or muted it is, and lightness (L) shows how close it is to black or white. Together, these three values can be used directly in CSS as hsl(H, S%, L%).
How is RGB converted to HSL?
R, G, and B are first scaled to a 0-1 range. Lightness (L) is the average of the highest and lowest channel. Saturation (S) is the difference between channels relative to lightness, and hue (H) is calculated across a 0-360 degree range based on which channel is dominant.
Formula
- R, G, and B values are divided by 255 to scale them to a 0-1 range.
- The largest (max) and smallest (min) of the scaled values are found.
- Lightness (L) is calculated as the average of the max and min values.
- Saturation (S) is found by normalizing the max-min difference relative to lightness.
- Hue (H) is calculated across a 0-360 degree range based on which channel (R, G, or B) is dominant.
Example RGB to HSL conversion
R=52, G=152, B=219 (a vivid blue) converts to approximately H=204 degrees, S=70%, L=53%.
Tips for RGB to HSL conversion
- Enter R, G, and B as whole numbers between 0 and 255; values outside that range are not a valid color.
- Hue (H) is a position on a 0-360 degree color wheel: 0 means red, 120 means green, 240 means blue.
- Saturation and lightness are read as percentages; 0% saturation is a shade of gray, and 100% lightness is white.
Comparisons
HSL(0°, 100%, 50%)
Pure red; the starting point of the hue wheel.
HSL(120°, 100%, 50%)
Pure green; 120 degrees around the color wheel.
HSL(240°, 100%, 50%)
Pure blue; 240 degrees around the color wheel.
HSL(0°, 0%, 50.2%)
Neutral gray; hue is visually meaningless once saturation is zero.
RGB to HSL color conversion guide
The RGB (Red, Green, Blue) model mirrors exactly how screens produce color by emitting light: each channel takes an intensity value from 0 to 255, and combining the three channels produces millions of distinct colors. However, this model is not intuitive when you want to make a color 'lighter' or 'more vivid,' since you would need to adjust all three channels at once.
The HSL (Hue, Saturation, Lightness) model instead describes colors the way the human eye perceives them: hue identifies what the color is (red, green, purple), saturation shows how vivid it is, and lightness shows how light or dark it is. This is why designers and developers often prefer HSL when building color palettes.
This tool scales your RGB input to a 0-1 range, then finds the highest and lowest channel values to calculate lightness and saturation. It then determines which channel is dominant to find the hue's exact position on the color wheel.
The biggest advantage of the HSL format is that it can be used directly in CSS as hsl(hue, saturation%, lightness%). For example, to create a darker variant of a brand's primary color, you only need to lower the lightness value — in RGB, you would need to recalculate all three channels separately.
Color conversions like this are common in web design, logo work, data visualization, and UI theming systems. Converting RGB to HSL is a practical starting point for developers who want to build light/dark theme variants or a consistent color palette.
FAQ
What is RGB?
RGB is a color model that builds on-screen colors by combining red, green, and blue light intensities, each ranging from 0 to 255.
What is HSL?
HSL describes a color using three components — hue, saturation, and lightness — matching how the human eye perceives color more closely than RGB does.
Why convert RGB to HSL?
HSL makes operations like lightening, darkening, or adjusting a color's vividness far more intuitive than RGB, which is why it is common in design tools.
What does the hue (H) value represent?
Hue is a position on a 0-360 degree color wheel: 0 degrees is red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, and 300 is magenta.
What happens when saturation (S) is zero?
When saturation is zero, the color becomes a pure shade of gray and the hue value has no visible effect; the result depends only on the lightness (L) value.
What happens when lightness (L) is 0% or 100%?
At 0% lightness the color becomes pure black, and at 100% it becomes pure white; in both cases saturation and hue have no visible effect.
Does the same RGB color always give the same HSL value?
Yes, RGB to HSL conversion is deterministic and mathematical; the same R, G, B input always produces the same H, S, L result.
What color formats does this tool support?
This tool converts RGB (red, green, blue) input into HSL (hue, saturation, lightness) output, which you can use directly in CSS with the hsl() function.
Related tools
Embed this tool on your site
<iframe src="https://pinfox.tech/en/tools/general/rgb-to-hsl-converter/?embed=1" width="100%" height="720" loading="lazy" style="border:0;border-radius:12px;overflow:hidden" title="RGB to HSL Color Converter - Pinfox"></iframe>