How HSV to HSL conversion works
HSV and HSL keep the same hue and differ in how they describe the rest. HSV says how bright the strongest channel is and how far the weakest falls below it; HSL says where the colour sits between black and white and how vivid it is at that lightness. The conversion is two short formulas.
- Hue is unchanged. Scale S and V to 0–1.
- L = V × (1 − S ÷ 2).
- S(HSL) = 0 if L is 0 or 1, otherwise (V − L) ÷ min(L, 1 − L).
- Report S and L in percent.
Worked example: hsv(270, 50%, 80%) to HSL
Here is the converter's own calculation for hsv(270, 50%, 80%), step by step. The result, hsl(270, 50%, 60%), is exactly what the tool above shows for this input.
- Chroma C = 0.8 × 0.5 = 0.4.
- X = 0.4 × (1 − |(270 ÷ 60) mod 2 − 1|) = 0.2.
- m = 0.8 − 0.4 = 0.4.
- 270° is in the 240–300° sector, so (R′, G′, B′) = (X, 0, C) = (0.2, 0, 0.4).
- Add m and multiply by 255: R = 153, G = 102, B = 204.
- R′ = 153 ÷ 255 = 0.6, G′ = 0.4, B′ = 0.8.
- Cmax = 0.8, Cmin = 0.4, Δ = 0.4.
- L = (0.8 + 0.4) ÷ 2 = 0.6.
- S = 0.4 ÷ (1 − |2 × 0.6 − 1|) = 0.5.
- Blue is largest: H = 60° × ((0.6 − 0.4) ÷ 0.4 + 4) = 270°.
- Rounded:
hsl(270, 50%, 60%).
Same hue, different saturation and lightness in HSV and HSL
Hue 120° (green) at a grid of values, to show how the two saturation scales diverge.
| Colour | HSV | HSL |
|---|---|---|
| S 100%, 25% | hsv(120, 100%, 50%) | hsl(120, 100%, 25%) |
| S 100%, 50% | hsv(120, 100%, 100%) | hsl(120, 100%, 50%) |
| S 100%, 75% | hsv(120, 50%, 100%) | hsl(120, 100%, 75%) |
| S 100%, 90% | hsv(120, 20%, 100%) | hsl(120, 100%, 90%) |
| S 50%, 25% | hsv(120, 67%, 38%) | hsl(120, 50%, 25%) |
| S 50%, 50% | hsv(120, 66%, 75%) | hsl(120, 50%, 50%) |
| S 50%, 75% | hsv(120, 29%, 87%) | hsl(120, 49%, 75%) |
| S 20%, 50% | hsv(120, 33%, 60%) | hsl(120, 20%, 50%) |
| S 20%, 85% | hsv(120, 7%, 88%) | hsl(120, 19%, 85%) |
Precision test: every HSV value through the converter
Of the 3,672,360 whole-number HSV values, 21.259% return exactly after HSV → HSL → HSV, with the largest drift 3 RGB levels (#FFE8E8 came back as #FFE5E5). Expect small changes when you move a colour from a design picker into CSS and back.
Method: every whole-number HSV value, through the converter's own code and back, compared on the 0–255 scale (how we test).
| Measure | Result |
|---|---|
| HSV values tested | 3,672,360 |
| Distinct HSL results | 1,541,981 |
| Came back exactly | 21.259% |
| Largest change (0–255 levels) | 3 |
| Average change | 0.9897 |
Last updated · Source: Pixohub exhaustive test of lib/color-math.ts
Where you'll use HSV to HSL
From picker to stylesheet
You chose a colour in Photoshop or Figma's HSB mode and want to write it as hsl() so you can tweak lightness in CSS.
Comparing the two saturation scales
The grid on this page shows how HSV saturation and HSL saturation diverge for the same colours, which helps when reading numbers from different tools.
Converting stored picker values
Apps that save colours as HSV (common in drawing apps) can expose them as CSS by converting to HSL.
Common mistakes
- Copying B from Photoshop into L: brightness and lightness are different scales.
- Expecting S to stay the same: for hsv(270, 50%, 80%), HSL saturation is 50% only by coincidence of the numbers chosen; most colours change.
- Rounding twice when chaining conversions.
- Assuming a fully saturated HSV colour is fully saturated in HSL too; it is, but only when V is 100% does L land at 50%.