OKLCH to HEX Converter

OKLCH in, HEX color code out — with the working shown.

To convert OKLCH to HEX, normalise the input, convert OKLCH back to RGB, write out the HEX value, then check the gamut. For example, oklch(61.82% 0.1935 258.33) in OKLCH is #2f81f7 in HEX.

This is a free OKLCH to HEX converter. Type or paste any OKLCH into the field above and the HEX value updates as you type, along with every other notation the web understands. HEX is a six-digit hexadecimal number, two digits per channel, written with a leading #.

Conversions run entirely in your browser using the same color engine as the rest of the site: values round-trip through linear sRGB and CIE XYZ rather than through an approximation, so what you copy is accurate to the last digit the format can carry.

How to convert OKLCH to HEX

  1. Normalise the input. Read the OKLCH value and scale each component into the 0–1 range the maths expects.
  2. Convert OKLCH back to RGB. OKLCH is not the display's native model, so the first move is always back to red, green and blue.
  3. Write out the HEX value. Convert back through sRGB and format the result as HEX.
  4. Check the gamut. Clamp anything that falls outside what an sRGB display can show, so the value you copy is the value you get.

Worked example: oklch(61.82% 0.1935 258.33) converts to #2f81f7. That color is Dodger Blue, and the tool above shows each intermediate step for whatever value you enter.

Common OKLCH to HEX values

The twenty colors people look up most often, converted from OKLCH to HEX. Every row is computed by the same engine as the tool above.

ColorOKLCHHEX
Whiteoklch(100% 0 0)#ffffff
Blackoklch(0% 0 0)#000000
Redoklch(62.8% 0.2577 29.23)#ff0000
Limeoklch(86.64% 0.2948 142.5)#00ff00
Blueoklch(45.2% 0.3132 264.05)#0000ff
Yellowoklch(96.8% 0.211 109.77)#ffff00
Cyanoklch(90.54% 0.1546 194.77)#00ffff
Magentaoklch(70.17% 0.3225 328.36)#ff00ff
Silveroklch(80.78% 0 0)#c0c0c0
Grayoklch(59.99% 0 0)#808080
Maroonoklch(37.67% 0.1546 29.23)#800000
Oliveoklch(58.07% 0.1266 109.77)#808000
Greenoklch(51.98% 0.1769 142.5)#008000
Purpleoklch(42.09% 0.1935 328.36)#800080
Tealoklch(54.31% 0.0927 194.77)#008080
Navyoklch(27.11% 0.1879 264.05)#000080
Orangeoklch(79.27% 0.171 70.67)#ffa500
Pinkoklch(86.77% 0.0735 7.09)#ffc0cb
Goldoklch(88.68% 0.1822 95.33)#ffd700
Crimsonoklch(57.12% 0.2219 20.09)#dc143c

OKLCH and HEX, briefly

OKLCH is OKLab in polar form — perceptual lightness, absolute chroma and a hue angle. Valid range: L 0–100%, C 0–0.37 in sRGB, H 0–360°.

HEX is a six-digit hexadecimal number, two digits per channel, written with a leading #. Valid range: #000000 to #ffffff.

Frequently asked questions

How do you convert OKLCH to HEX?

1. Read the OKLCH value and scale each component into the 0–1 range the maths expects. 2. OKLCH is not the display's native model, so the first move is always back to red, green and blue. 3. Convert back through sRGB and format the result as HEX. 4. Clamp anything that falls outside what an sRGB display can show, so the value you copy is the value you get. The converter on this page does all of it as you type, and shows the working underneath.

What is oklch(62.8% 0.2577 29.23) in HEX?

Pure red, oklch(62.8% 0.2577 29.23), is #ff0000 in HEX. There is a table of twenty common colors converted to HEX further up this page.

What is oklch(61.82% 0.1935 258.33) in HEX?

oklch(61.82% 0.1935 258.33) converts to #2f81f7. It is a dodger blue, and you can paste any other value into the field at the top of the page to convert it.

Is OKLCH to HEX conversion lossless?

Within sRGB, yes — converting to HEX and back returns the value you started with. The only rounding happens when a component is written out to a fixed number of decimal places.

Can I use HEX directly in CSS?

Yes. #2f81f7 is valid CSS and works in every current browser.

Does this OKLCH to HEX converter support transparency?

Alpha is preserved wherever the target notation can carry it — eight-digit hex, rgb() / a, hsl() / a and the modern CSS spaces all round-trip an alpha channel. CMYK has no alpha, so it is dropped there.

Is my color data sent anywhere?

No. Every conversion on this site runs in your browser with no network request, no account and no analytics. You can disconnect and it keeps working.