Rgb To Hsl
Free online rgb to hsl tool, no installation required
About RGB to HSL Converter
This tool converts a single color between four formats: RGB (0-255 per channel), HEX (#rrggbb), HSL (hue 0-360°, saturation and lightness 0-100%), and HSV (hue 0-360°, saturation and value 0-100%). Editing any field instantly updates all three other formats and the color preview swatch; each format also has a slider for fine control.
How to Use
1. Edit the RGB card: type a 0-255 number or drag the R/G/B slider; values are clamped to 0-255. 2. Edit the HEX card: type up to 6 hex digits (the leading # is added automatically); invalid input is ignored. 3. Edit the HSL card: H is 0-360°, S and L are 0-100%, each with a slider. 4. Edit the HSV card: H is 0-360°, S and V are 0-100%, each with a slider. 5. Use any card's copy button (or the All Formats panel) to copy rgb(), #hex, hsl(), or hsv() CSS strings to the clipboard.
Color Conversion Math
RGB→HSL: normalize r,g,b to 0-1; L = (max+min)/2; if delta≠0, S = delta/(2-max-min) when L>0.5 else delta/(max+min); H is derived from which channel is max: ((g-b)/delta mod 6) for r, ((b-r)/delta+2) for g, ((r-g)/delta+4) for b, then ×60. HSL→RGB uses the hue2rgb helper with q = L<0.5 ? L×(1+S) : L+S-L×S and p = 2L−q. HSV→RGB uses the hexacone model with i = floor(H×6) and six cases. RGB↔HEX is straight base-16 per channel.
▶Why does editing HSL also change the HSV and HEX values?
▶What is the difference between HSL and HSV?
▶Why did my HEX input not update the color?
▶Is my data sent to a server?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee