HEX to HSL converter
Royal blue #4169E1 is hsl(225, 73%, 57%): hue 225° on the color wheel, 73% saturation, 57% lightness.
#4169E1| RGB | rgb(65, 105, 225) | |
|---|---|---|
| HSL | hsl(225, 73%, 57%) | |
| HSV | hsv(225, 71%, 88%) | |
| HWB | hwb(225 25% 12%) | |
| CMYK | cmyk(71, 53, 0, 12) | |
| OKLCH | oklch(0.56 0.19 266) | |
| OKLAB | oklab(0.560 -0.012 -0.188) | |
| LAB | lab(46.8 17.8 -66.7) | |
| LCH | lch(46.8 69.0 285) | |
| DECIMAL | 4286945 | |
| ≈ | Royal blue |
Free·No sign-up·Works offline after the first visit
- 1. HEX to RGB, then divide by 255: R = 0.255, G = 0.412, B = 0.882.
- 2. Lightness L = (max + min) ÷ 2 = (0.882 + 0.255) ÷ 2 = 0.569 → 57%.
- 3. Saturation S = (max − min) ÷ (1 − |2L − 1|) = 0.627 ÷ 0.863 = 0.727 → 73%.
- 4. Hue: blue is the largest, so H = 60 × ((R − G) ÷ (max − min) + 4) = 60 × 3.75 = 225°.
Common colors in HEX and HSL
| color | HEX | HSL |
|---|---|---|
| White | #FFFFFF | hsl(0, 0%, 100%) |
| Black | #000000 | hsl(0, 0%, 0%) |
| Red | #FF0000 | hsl(0, 100%, 50%) |
| Lime | #00FF00 | hsl(120, 100%, 50%) |
| Blue | #0000FF | hsl(240, 100%, 50%) |
| Yellow | #FFFF00 | hsl(60, 100%, 50%) |
| Cyan | #00FFFF | hsl(180, 100%, 50%) |
| Magenta | #FF00FF | hsl(300, 100%, 50%) |
| Gray | #808080 | hsl(0, 0%, 50%) |
| Orange | #FFA500 | hsl(39, 100%, 50%) |
| Purple | #800080 | hsl(300, 100%, 25%) |
| Gold | #FFD700 | hsl(51, 100%, 50%) |
| HEX | RGB | |
|---|---|---|
| White | #FFFFFF | rgb(255, 255, 255) |
| Black | #000000 | rgb(0, 0, 0) |
| Red | #FF0000 | rgb(255, 0, 0) |
| Green | #008000 | rgb(0, 128, 0) |
| Blue | #0000FF | rgb(0, 0, 255) |
| Yellow | #FFFF00 | rgb(255, 255, 0) |
| Orange | #FFA500 | rgb(255, 165, 0) |
| Purple | #800080 | rgb(128, 0, 128) |
| Pink | #FFC0CB | rgb(255, 192, 203) |
| Gray | #808080 | rgb(128, 128, 128) |
| Gold | #FFD700 | rgb(255, 215, 0) |
| Navy blue | #000080 | rgb(0, 0, 128) |
How to convert HEX to HSL by hand
HSL describes a color by hue, saturation and lightness, which is close to how people talk about color. The hue is an angle on the color wheel: 0° is red, 120° green, 240° blue. Saturation says how strong the color is, from gray (0%) to full color (100%). Lightness runs from black (0%) through the pure color (50%) to white (100%).
To convert, turn the HEX code into RGB values between 0 and 1, find the largest and smallest, and follow the four steps above. When all three channels are equal, the color is a gray: saturation is 0 and the hue doesn't matter. Designers like HSL for building shades: keep the hue and saturation of a brand color, change only the lightness, and you get a lighter or darker version that still belongs to it. In CSS you can write it directly: hsl(225 73% 57%).
Questions and answers
How do I convert HEX to HSL?
Convert to RGB (0-1), then L = (max + min) ÷ 2, S = (max − min) ÷ (1 − |2L − 1|), and the hue from whichever channel is largest.
What is the HSL of white?
hsl(0, 0%, 100%). Black is hsl(0, 0%, 0%).
Is HSL the same as HSV or HSB?
No. They share the hue, but HSV measures brightness differently: in HSV, 100% is the brightest color, not white.