Skip to content
ZeroServer.tools

OKLCH to HEX Converter

Convert an OKLCH color (Lightness, Chroma, Hue) to a standard HEX color code, entirely in your browser.

L: 0.6 C: 0.15 H: 250°

HEX

#2784d5

RGB

Red
39
Green
132
Blue
213
rgb(39, 132, 213)

CSS Snippets

color: #2784d5;
background-color: #2784d5;
border-color: #2784d5;

How OKLCH to HEX conversion works

OKLCHis a cylindrical form of the OKLab perceptual color space, expressed as Lightness (0–1), Chroma (colorfulness), and Hue (0–360°). Because it's perceptually uniform, OKLCH is increasingly used in modern CSS for defining color scales, gradients, and themes that look consistent across hues. HEX, on the other hand, is the classic sRGB-based format (#rrggbb) supported everywhere.

To convert, this tool first turns OKLCH into OKLab (a = C·cos(H), b = C·sin(H)), then reverses Björn Ottosson's OKLab transform to get linear LMS values, converts those to linear sRGB, and finally gamma-encodes the result to standard sRGB before packing it into a HEX string — all client-side in your browser. Since OKLCH can describe colors outside the sRGB gamut (colors your screen and HEX can't represent), out-of-gamut inputs are clamped to the nearest valid sRGB color.

Need to go the other way? Try OKLCH Color Converter (HEX to OKLCH/OKLab), or convert HEX to other spaces with HEX to RGB and the all-in-one color converter.

Private & free — this tool runs entirely in your browser.

Recommended: IndieKit Ship your Next.js startup in days.affiliate

Related Converters tools