hex to OKLCh

OKLCh lightness tracks what the eye sees, so two colours with the same L look equally bright. That makes it the right space for building tonal scales.

Hue
Alpha
100%
OKLCh
oklch(63.521% 0.17906 259.418)

Paste a hex value — other formats work too.

Need every format at once? Open in the full picker

Worked examples

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

ColourhexOKLChCopy
Pure red#ff0000oklch(62.796% 0.25768 29.234)
Pure green#00ff00oklch(86.644% 0.29483 142.495)
Pure blue#0000ffoklch(45.201% 0.31321 264.052)
White#ffffffoklch(100% 0 0)
Mid grey#808080oklch(59.987% 0 0)
Black#000000oklch(0% 0 0)
Interface blue#4287f5oklch(63.521% 0.17906 259.418)
Success green#22c55eoklch(72.275% 0.19201 149.579)
Danger red#ef4444oklch(63.683% 0.20785 25.331)
Warning amber#f59e0boklch(76.859% 0.16466 70.08)
Editor black#1e1e1eoklch(23.503% 0 0)
Warm sand#e9c46aoklch(83.419% 0.11701 87.428)

How the conversion works

OKLCh lightness tracks what the eye sees, so two colours with the same L look equally bright. That makes it the right space for building tonal scales.

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