Convert color from OKLCH to HEX

OKLCH to HEX converter

Turn an oklch() color into a HEX fallback.

Example: oklch(70.45% 0.1926 39.23)

HEX
See this color in all formats

About OKLCH to HEX Converter

oklch() can describe colors a standard screen cannot show. When you need a HEX fallback for an older browser, an email or a tool without oklch() support, this finds the closest color that fits in sRGB and writes it as HEX.

About the formats. OKLCH is a perceptual color model built on Björn Ottosson's OKLab space: L is lightness from 0% to 100%, C is chroma (how vivid the color is, from 0 for grey up to about 0.32 inside sRGB) and H is the hue angle in degrees. Lightness tracks what the eye sees, so equal L values look equally light. A HEX code writes the red, green and blue channels as two hexadecimal digits each, so #ff6b35 is red ff (255), green 6b (107) and blue 35 (53). The leading # is optional here, the short forms #f63 and #f63a work, and the 8-digit form #RRGGBBAA adds transparency.

How exact is it? OKLCH can describe colors that a standard screen cannot show. When the color is outside sRGB, its chroma is lowered, keeping lightness and hue, until it fits, which is how browsers handle it too; colors already inside sRGB convert unchanged. The result is written as six hex digits (eight when the color is partly transparent), which gives one of 256 levels per channel.

For example, oklch(86.81% 0.1595 178.2) in OKLCH is #00f5d4 in HEX. If the color is outside sRGB, which happens with high chroma, the converter lowers the chroma while keeping lightness and hue, as browsers do, and tells you it did. Colors that fit convert with no change.

How to convert OKLCH to HEX

  1. Type or paste an OKLCH color, such as oklch(86.81% 0.1595 178.2), or choose a color with the picker.
  2. The HEX value, #00f5d4 for that example, appears straight away.
  3. Press Copy to put the HEX value on your clipboard.
  4. Use the From and To menus at the top to switch to a different conversion, or open the all-formats page to see every format at once.

Frequently asked questions

How do I convert OKLCH to HEX?

Type or paste an OKLCH value such as oklch(86.81% 0.1595 178.2) and the HEX value, #00f5d4, appears straight away. Use Copy to put it on your clipboard, or choose a color with the picker.

What if my OKLCH color is outside sRGB?

Chroma is reduced step by step, keeping the same lightness and hue, until the color fits. You will see a note under the input when that happens. The HEX is then the closest sRGB color, not an exact match.

Can I use a percentage for chroma?

Yes. 100% equals a chroma of 0.4, so oklch(70% 50% 150) is read as oklch(70% 0.2 150). Lightness can be a percentage or a number from 0 to 1.

Is converting OKLCH to HEX exact?

OKLCH can describe colors that a standard screen cannot show. When the color is outside sRGB, its chroma is lowered, keeping lightness and hue, until it fits, which is how browsers handle it too; colors already inside sRGB convert unchanged. The result is written as six hex digits (eight when the color is partly transparent), which gives one of 256 levels per channel.

Does OKLCH to HEX keep transparency?

Yes. Add transparency to the OKLCH value and it is carried over to the HEX result, which supports it too.

Are my colors sent anywhere?

No. The conversion runs in your browser and nothing is uploaded.