HEX to OKLCH converter

OKLCH is a CSS colour format, oklch(L C H), that describes a colour by perceived lightness, chroma (colourfulness) and hue, so equal lightness values look equally bright. Paste a HEX code below to get its OKLCH value, or move the sliders to pick a colour in OKLCH.

54.6
0.21520774805039064
263
OKLCHoklch(54.6% 0.215 262.9)
HEX#2563eb
RGBrgb(37, 99, 235)
HSLhsl(221, 83%, 53%)

Common colours in OKLCH

HEX values and their OKLCH equivalents, computed from the same conversion the tool uses.
ColourHEXOKLCH
White#ffffffoklch(100% 0 0)
Black#000000oklch(0% 0 0)
Red#ef4444oklch(63.7% 0.208 25.3)
Orange#f97316oklch(70.5% 0.187 47.6)
Yellow#eab308oklch(79.5% 0.162 86)
Green#22c55eoklch(72.3% 0.192 149.6)
Blue#2563eboklch(54.6% 0.215 262.9)
Purple#a855f7oklch(62.7% 0.233 303.9)

OKLCH vs HSL

FeatureOKLCHHSL
LightnessPerceptual: equal L values look equally bright.Mathematical: equal L values can look very different.
Wide-gamut P3 supportYes, oklch() can describe Display P3 colors.No, hsl() is limited to sRGB.
Browser supportAll current browsers since 2023.All browsers, for many years.

OKLCH questions

What is OKLCH in CSS?

OKLCH is a CSS colour format written oklch(L C H). L is perceived lightness from 0 to 100%, C is chroma (colourfulness), and H is hue in degrees. Because lightness is perceptual, two colors with the same L look equally bright.

How do I convert HEX to OKLCH?

Paste the HEX code into the converter above. It turns the sRGB channels into OKLab, then reads them as lightness, chroma and hue, and shows the matching oklch() value ready to copy into your CSS.

Why does my OKLCH colour say outside sRGB?

OKLCH can describe colors wider than a normal sRGB screen can show. When the chroma is too high for the lightness and hue, the color falls outside sRGB, and this converter lowers the chroma until it fits while keeping the lightness and hue.

Does Tailwind CSS use OKLCH?

Yes. Tailwind CSS v4 writes its default palette in oklch(), which gives a more even lightness scale than the old hex values. You can build your own scale in the Tailwind color generator.

Related tools

More color tools

Image tools

CSS generators

Image & SVG tools

Typography & units

More free tools

All free tools