OKLCH to HEX

← Color converter

Paste an oklch() function and read the HEX value that renders the same color. A color outside the sRGB gamut is clipped channel by channel to the nearest HEX. That is a different rule from the chroma reduction a browser applies, so a strongly saturated oklch() can land a few steps away from what the browser renders.

How to convert OKLCH to HEX

  1. Paste the oklch() function into the OKLCH field. Lightness works as a percentage or as a number from 0 to 1.
  2. Read the HEX field. Click Copy to put it on the clipboard.
  3. Edit any other field to go the other way. The OKLCH field follows.

FAQ

Does the field accept oklch(0.62 0.19 260) without the percent sign?
Yes. Lightness as 0 to 1 or as 0% to 100%, chroma as a number or as a percentage of 0.4, and hue as a bare number or with deg, rad, grad or turn. The commas of the older syntax work as well.
What happens to an oklch() color that sRGB cannot show?
Each of red, green and blue is clipped to the 0–255 range. The result is the nearest HEX in channel terms, which can be a little lighter or less saturated than the color you asked for.
Why design in OKLCH if the CSS ends up as HEX?
Because OKLCH is the space to reason in. Two colors with the same OKLCH lightness look equally bright, and a hue rotation keeps the lightness. HEX is what older browsers and most design tools still read.
Does this store or send my colors anywhere?
No. The conversion runs in your browser and makes no network requests.