HSV to HEX Converter

Drag the picker, type three numbers, or paste a color straight from your code. Got HSV out of OpenCV, Python or Android? Switch the input scale first, then copy the six-digit code your stylesheet expects.

Input scale

Three numbers in H, S, V order, read with the scale picked above.

Show the math
  1. C = V × S = 0.86 × 0.72 = 0.6192
  2. H′ = 204 ÷ 60 = 3.4, sector 3 (180° to 240°)
  3. X = C × (1 − |H′ mod 2 − 1|) = 0.3715
  4. m = V − C = 0.2408
  5. (R′, G′, B′) = (0, X, C)
  6. RGB = (R′+m, G′+m, B′+m) × 255 = 61, 156, 219
  7. HEX = 3D · 9C · DB = #3D9CDB
One color per line, same scale as above

    HSV is how most color pickers think. Photoshop calls it HSB, Figma lists it beside HEX, and OpenCV uses it to pick objects out of camera frames. Browsers never read it. CSS has no hsv() function, so a color chosen in HSV has to become HEX, rgb() or hsl() before a stylesheet accepts it.

    Same three numbers, four different meanings

    Most bad conversions here come from a scale mismatch, not from the formula. Each program stores HSV in its own range, and the numbers look plausible in every one of them.

    Where the numbers came fromHueSaturation, valuePick this scale
    Photoshop, Figma, Affinity (labelled HSB)0 to 3600 to 100Degrees + percent
    GIMP, Krita0 to 3600 to 100Degrees + percent
    OpenCV on 8-bit images0 to 1790 to 255OpenCV 8-bit
    Python colorsys, Unity, Blender0 to 10 to 1Unit floats
    Android Color.HSVToColor0 to 3600 to 1Android

    A real case: OpenCV reports a pixel as (100, 180, 220). Read as degrees, hue 100 lands on a bright green, and 180 overflows the percent range. OpenCV halves hue to fit one byte, so the true hue is 200 degrees, a clear sky blue, #41A8DC. Pick the OpenCV 8-bit scale and the converter doubles the hue and rescales S and V for you.

    The conversion, worked by hand

    Here is the default color on this page, hsv(204, 72%, 86%), taken through the same steps the math panel shows live:

    C = V x S = 0.86 x 0.72 = 0.6192
    H' = H / 60 = 204 / 60 = 3.4 (sector 3)X = C x (1 - |H' mod 2 - 1|) = 0.6192 x 0.6 = 0.3715
    m = V - C = 0.86 - 0.6192 = 0.2408
    sector 3 gives (R', G', B') = (0, X, C)R = (0 + 0.2408) x 255 = 61.4 -> 61 -> 3D
    G = (0.3715 + 0.2408) x 255 = 156.1 -> 156 -> 9C
    B = (0.6192 + 0.2408) x 255 = 219.3 -> 219 -> DB
    Result: #3D9CDB

    Two details trip up hand calculations. First, hue falls into one of six 60-degree sectors, and the sector decides which channel gets C, which gets X, and which gets zero:

    Second, round once, at the very end. Round C, X or m to two places along the way and a channel slips by one step. hsv(204, 55%, 60%) should give #457799, but early rounding returns #457899, and nothing on screen tells you why.

    Why the copy row offers hwb()

    If you want to keep thinking in HSV inside a stylesheet, hwb() is the closest native option. It shares the hue wheel and swaps saturation and value for whiteness and blackness:

    W = (1 - S) x V
    B = 1 - V

    Safari has supported hwb() since version 15, Firefox since 96 and Chrome since 101. Older CSS minifiers, some email clients and design tokens pipelines still reject it, so HEX stays the safer default for anything shared outside a modern browser.

    Where the HEX result stops being exact

    Check the scale, read the math panel when a number looks off, and trust the HEX for anything going into CSS.

    HSV to HEX questions

    Is HSB the same as HSV?

    Yes. Adobe labels the model HSB, for brightness, while most other software says HSV, for value. The math is identical, so numbers from the Photoshop or Figma picker go straight in with the Degrees + percent scale.

    Why does my OpenCV color come out wrong?

    OpenCV stores 8-bit hue as 0 to 179 and saturation and value as 0 to 255. Entered as degrees and percent, those numbers point at a different color. Pick the OpenCV 8-bit scale before typing or pasting, and the converter rescales all three channels.

    How do I convert a whole palette at once?

    Paste one color per line into the batch box. Each line needs three numbers in the current scale, separated by commas or spaces. Lines without three numbers are flagged and skipped, out-of-range values are clamped, and the copy buttons return plain HEX codes or ready CSS custom properties.

    Is HSV the same as HSL?

    No. Both share the hue angle, but the other two numbers mean different things. hsv(0, 100%, 100%) is pure red, #FF0000. hsl(0, 100%, 100%) is white. Copy the HSL chip from the result panel instead of retyping HSV numbers into an hsl() function.

    Are my colors sent to a server?

    No. Every conversion, including the batch list, runs in your browser. Nothing you type or paste leaves the page.