Converters
RGB to HSL Converter
Convert any RGB color to HSL — hue, saturation and lightness — with exact precision. Live color preview, one-click copy for each channel and the full hsl() CSS value. Runs in your browser, no upload, no signup.
RGB input
Try an example:
#267D70
Live preview
HSL output
170°
53%
32%
CSS value
hsl(170, 53%, 32%)
How to convert RGB to HSL — the exact method
- Normalize R, G and B to the 0–1 range by dividing each by 255.
- Compute the maximum, minimum and delta of the three normalized channels.
- Lightness is the average of max and min.
- Saturation is derived from the delta and lightness (or the reciprocal).
- Hue is derived from which channel dominates, converted to degrees.
Example: rgb(38, 125, 112) → hsl(170°, 53%, 32%).
Quick RGB to HSL reference chart
| Color | RGB | HSL |
|---|---|---|
| Red | 255, 0, 0 | hsl(0, 100%, 50%) |
| Yellow | 255, 255, 0 | hsl(60, 100%, 50%) |
| Green | 0, 255, 0 | hsl(120, 100%, 50%) |
| Cyan | 0, 255, 255 | hsl(180, 100%, 50%) |
| Blue | 0, 0, 255 | hsl(240, 100%, 50%) |
| Magenta | 255, 0, 255 | hsl(300, 100%, 50%) |
| White | 255, 255, 255 | hsl(0, 0%, 100%) |
| Black | 0, 0, 0 | hsl(0, 0%, 0%) |
| Teal (brand) | 38, 125, 112 | hsl(170, 53%, 32%) |
Why designers convert RGB to HSL
- Hover and pressed states — adjust only lightness to keep hue and saturation consistent.
- Palette generation — hue rotation in HSL is what powers complementary, analogous and triadic palettes.
- Readable tokens — HSL communicates intent better than raw channel numbers.
- Programmatic theming — CSS custom properties with HSL values can be manipulated with
calc().
FAQ
How do I convert RGB to HSL?
Normalize each channel to 0–1, compute max, min and delta, then derive hue, saturation and lightness using the standard CSS Color Module Level 3 formula.
What is the difference between HSL and HSV?
HSL uses lightness and is designed for CSS; HSV (also called HSB) uses value and is common in design software. They are not interchangeable — the same numbers produce different colors.
Is RGB to HSL conversion lossless?
Yes. HSL is computed from exact RGB values, and round-tripping reproduces the original RGB with consistent rounding.
Can I use hsl() in CSS?
Yes.
hsl() is supported in every modern browser and is a standard CSS Color Module Level 3 function.Can I use HSL for accessibility contrast checks?
You can, but WCAG contrast is computed from relative luminance, not HSL. Use our Contrast Checker for WCAG-compliant evaluation.
Is the tool free and private?
Yes. Free, no signup, all processing in your browser. Nothing is uploaded.