OKLCH to hex converter

Convert a hex color to CSS oklch() and an in-gamut oklch() back to hex. Out-of-gamut values do not invent a hex.

Loading tool…

Recommended next step

Design and validate your interface

After using OKLCH to hex converter, continue with 3D modeler.

Open next

Tools selected to complete the same task.

4 steps

Tool guide

OKLCH to hex converter: how it works

Practical information to understand the result and use this tool correctly.

About OKLCH to hex converter

This converts between sRGB hex and CSS oklch(). It does not check WCAG contrast or build a clamp() line.

Lightness is 0 to 1. A percent such as 62% is accepted and treated as 0.62.

A color outside the sRGB gamut returns no hex. The tool does not clip and call it exact.

How to use it

  1. 1Paste #0f766e or use the example.
  2. 2Read the oklch() line, or switch the field to an oklch() value.
  3. 3Copy the result. Reset clears the field.

Frequently asked questions

What does #0f766e become?
oklch(0.5109 0.0861 186.4). The same line converts back to #0f766e.
What happens with oklch(0.7 0.15 180)?
It is outside sRGB. No hex is produced.
Is the color uploaded?
No. The conversion runs in the browser. Nothing is sent.