RGB to HSL Converter
Type a RGB value and get HSL straight away. Everything runs in your browser — nothing is sent to a server.
HOW
How the conversion works
Normalise the three channels to 0–1 and find the maximum and minimum. Lightness is (max+min)/2, saturation is their difference adjusted for lightness, and hue depends on which channel is largest.
EXAMPLES
RGB to HSL examples
| Color | RGB | HSL |
|---|---|---|
| Red | rgb(255, 0, 0) |
hsl(0, 100%, 50%) |
| Tomato | rgb(255, 99, 71) |
hsl(9, 100%, 64%) |
| Orange | rgb(255, 165, 0) |
hsl(39, 100%, 50%) |
| Gold | rgb(255, 215, 0) |
hsl(51, 100%, 50%) |
| Limegreen | rgb(50, 205, 50) |
hsl(120, 61%, 50%) |
| Teal | rgb(0, 128, 128) |
hsl(180, 100%, 25%) |
| Dodgerblue | rgb(30, 144, 255) |
hsl(210, 100%, 56%) |
| Royalblue | rgb(65, 105, 225) |
hsl(225, 73%, 57%) |
| Blueviolet | rgb(138, 43, 226) |
hsl(271, 76%, 53%) |
| Hotpink | rgb(255, 105, 180) |
hsl(330, 100%, 71%) |
MORE