OKLCH to HEX and RGB converter

Enter the OKLCH values from your design system to get a HEX fallback or a color to share with teams that do not use OKLCH.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter lightness l (0 to 1), chroma c and hue angle h.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

a = C cos(h), b = C sin(h), then the inverse OKLab equations to linear RGB. Linear RGB is then encoded per IEC 61966-2-1: 12.92 l if l ≤ 0.0031308, else 1.055 l^(1/2.4) − 0.055, times 255 and rounded.

Example

Inputs: Lightness L (0 to 1) = 0.7, Chroma C = 0.15, Hue angle h = 250 °. Result: HEX code: #4BA3F7; Gamut status: Inside the sRGB gamut.

Limits and caveats

  • Colors outside sRGB have their channels clipped to 0-255, which shifts the displayed color.
  • Browsers reduce chroma for out of gamut colors instead of clipping, so the browser may show a slightly different color.

Questions about this tool

How do I enter oklch(70% 0.15 250)?

Type L = 0.7, C = 0.15 and H = 250. A lightness percentage is divided by 100.

Why did the color change after conversion?

If the out of gamut message shows, one or more channels were clipped. Lowering C a little brings the color back inside sRGB.

How precise is the HEX result?

Precise to 8 bits: each channel is rounded to the nearest whole number from 0 to 255.