HSV to hex

HSV and HSB are the same model under two names. It is what most colour picker squares actually manipulate.

Hue
Alpha
100%
hex
#4287f5

Paste a HSV value — other formats work too.

Need every format at once? Open in the full picker

Worked examples

Common colours converted from HSV to hex, computed with the same engine the picker uses.

ColourHSVhexCopy
Pure redhsv(0, 100%, 100%)#ff0000
Pure greenhsv(120, 100%, 100%)#00ff00
Pure bluehsv(240, 100%, 100%)#0000ff
Whitehsv(300, 0%, 100%)#ffffff
Mid greyhsv(300, 0%, 50.2%)#808080
Blackhsv(0, 0%, 0%)#000000
Interface bluehsv(216.9, 73.1%, 96.1%)#4287f5
Success greenhsv(142.1, 82.7%, 77.3%)#22c55e
Danger redhsv(0, 71.5%, 93.7%)#ef4444
Warning amberhsv(37.7, 95.5%, 96.1%)#f59e0b
Editor blackhsv(0, 0%, 11.8%)#1e1e1e
Warm sandhsv(42.5, 54.5%, 91.4%)#e9c46a

How the conversion works

HSV and HSB are the same model under two names. It is what most colour picker squares actually manipulate.

Both formats are computed from a single canonical representation — CIE XYZ with a D65 white point, held in floating point — rather than by chaining one format into the next. That matters because chained conversions accumulate rounding error, and because it means a colour that cannot be represented in the target format is handled deliberately rather than by accident.

When the source describes a colour outside the target's gamut, chroma is reduced in OKLCh while lightness and hue are held, following the CSS Color 4 gamut mapping algorithm. Clipping each channel independently would be simpler but visibly shifts hue on saturated colours.

Related conversions