HSL to HSV Converter

HSL to HSV: hsl(120, 60%, 40%) = hsv(120, 75%, 64%). See the formula worked step by step, a reference table, and our test of every HSL value.

How to use HSL to HSV

  1. 1Enter an HSL colour from your stylesheet.
  2. 2Read the HSV/HSB numbers for Photoshop, Procreate or Figma's HSB mode.
  3. 3Keep the hue; only saturation and brightness change.

Features

  • Two-line formula with a worked example
  • Saturation grid showing how the scales diverge
  • Round-trip drift measured in both directions

How HSL to HSV conversion works

HSL and HSV share the same hue, so converting between them only remaps the other two numbers. HSL measures lightness from black to white with the purest colour at 50%; HSV measures value from black to the purest colour at 100%. Saturation is redefined to match.

  • Scale S and L to 0–1. Hue stays the same.
  • V = L + S × min(L, 1 − L).
  • S(HSV) = 0 if V = 0, otherwise 2 × (1 − L ÷ V).
  • Report H in degrees and S(HSV), V in percent.

Worked example: hsl(120, 60%, 40%) to HSV

Here is the converter's own calculation for hsl(120, 60%, 40%), step by step. The result, hsv(120, 75%, 64%), is exactly what the tool above shows for this input.

  • Chroma C = (1 − |2 × 0.4 − 1|) × 0.6 = 0.48.
  • X = 0.48 × (1 − |(120 ÷ 60) mod 2 − 1|) = 0.
  • m = 0.4 − 0.48 ÷ 2 = 0.16.
  • 120° is in the 120–180° sector, so (R′, G′, B′) = (X, C, X) = (0, 0.48, 0).
  • Add m and multiply by 255: R = 41, G = 163, B = 41.
  • R′ = 41 ÷ 255 = 0.161, G′ = 0.639, B′ = 0.161.
  • Cmax = 0.639, Cmin = 0.161, Δ = 0.478.
  • V = Cmax = 0.639.
  • S = Δ ÷ V = 0.748.
  • Green is largest: H = 60° × ((0.161 − 0.161) ÷ 0.478 + 2) = 120°.
  • Rounded: hsv(120, 75%, 64%).

Same hue, different saturation and lightness in HSL and HSV

Hue 120° (green) at a grid of values, to show how the two saturation scales diverge.

ColourHSLHSV
S 100%, 25%hsl(120, 100%, 25%)hsv(120, 100%, 50%)
S 100%, 50%hsl(120, 100%, 50%)hsv(120, 100%, 100%)
S 100%, 75%hsl(120, 100%, 75%)hsv(120, 50%, 100%)
S 100%, 90%hsl(120, 100%, 90%)hsv(120, 20%, 100%)
S 50%, 25%hsl(120, 50%, 25%)hsv(120, 67%, 38%)
S 50%, 50%hsl(120, 50%, 50%)hsv(120, 66%, 75%)
S 50%, 75%hsl(120, 50%, 75%)hsv(120, 29%, 87%)
S 20%, 50%hsl(120, 20%, 50%)hsv(120, 33%, 60%)
S 20%, 85%hsl(120, 20%, 85%)hsv(120, 7%, 88%)

Precision test: every HSL value through the converter

This is the pair where rounding bites hardest in both directions: of the 3,672,360 whole-number HSL values, 24.346% come back exactly after HSL → HSV → HSL, with drift of up to 3 RGB levels (#F6C8C6 → #F5C5C4). The two grids don't line up, so most whole-number HSL colours sit between whole-number HSV ones.

Method: every whole-number HSL value, through the converter's own code and back, compared on the 0–255 scale (how we test).

MeasureResult
HSL values tested3,672,360
Distinct HSV results1,609,995
Came back exactly24.346%
Largest change (0–255 levels)3
Average change0.7999

Last updated · Source: Pixohub exhaustive test of lib/color-math.ts

Where you'll use HSL to HSV

Moving a colour from CSS into a picker

Stylesheets use HSL, while Photoshop, Procreate and Figma's HSB mode use HSV. Converting tells you exactly where to place the brightness slider.

Explaining saturation differences

The grid below shows the same hue at several HSL saturation and lightness values with their HSV equivalents. Light tints have low HSV saturation but can be 100% saturated in HSL.

Porting colour logic between libraries

Code written against an HSL helper (CSS, chroma.js) and code using HSV (OpenCV, Unity) often need the same colour in both.

Common mistakes

  • Copying S across unchanged: hsl(120, 60%, 40%) and hsv(120, 60%, 40%) are different greens.
  • Assuming V and L are both "brightness": white is L = 100% but V = 100% with S = 0%.
  • Converting back and forth repeatedly with rounding, which drifts the colour.
  • Forgetting that at L = 0% (black) saturation is undefined in both models.

Frequently asked questions

What is hsl(120, 60%, 40%) in HSV?

hsv(120, 75%, 64%). V = 0.4 + 0.6 × 0.4 = 0.64; S = 2 × (1 − 0.4 ÷ 0.64) = 0.75.

Is hue the same in HSL and HSV?

Yes, both use the same angle around the colour wheel, so only saturation and lightness/value change.

Why does a pastel have 100% saturation in HSL?

HSL saturation is measured relative to the most colourful option at that lightness. Near white there is little room, so even a faint tint can max out S. HSV measures saturation relative to brightness instead.

How much precision is lost?

With whole numbers, 24.346% of HSL values survive the round trip exactly; the rest move by at most 3 RGB levels.

More text, code & dev tools