Skip to content
ZeroServer.tools

RGB to OKLCH Converter

Enter an RGB color and instantly get its OKLCH and OKLab equivalents — the modern, perceptually uniform color spaces natively supported in CSS.

Red
Green
Blue
rgb(59, 130, 246)

OKLCH

Lightness (L)
0.623
0 = black, 1 = white
Chroma (C)
0.1880
0 = grey, higher = vivid
Hue (H)
259.81°
0-360° color wheel
oklch(0.623 0.1880 259.81)

OKLab

Lightness (L)
0.623
Green-Red (a)
-0.0332
Blue-Yellow (b)
-0.1851
oklab(0.623 -0.0332 -0.1851)

CSS Snippets

color: oklch(0.623 0.1880 259.81);
background-color: oklch(0.623 0.1880 259.81);
color: oklab(0.623 -0.0332 -0.1851);

How RGB to OKLCH conversion works

RGB describes a color as an additive mix of red, green, and blue light on a 0–255 scale — simple for screens, but not perceptually uniform: equal numeric steps in RGB don't look like equal steps in brightness or hue. OKLCH (Lightness, Chroma, Hue) fixes that. This tool converts your RGB value to linear-light sRGB, then into the LMS cone-response space, and finally into OKLab/OKLCH coordinates using Björn Ottosson's published OKLab matrices — the same math implemented natively in modern browsers' oklch() CSS function.

Why convert to OKLCH?

OKLCH makes it easy to build accessible color scales, adjust lightness without shifting perceived hue, and interpolate between colors smoothly — gradients built in OKLCH avoid the muddy grey banding common with RGB or HSL.

Browser support

oklch() and oklab() are natively supported in Chrome 111+, Firefox 113+, and Safari 15.4+. Every RGB color maps to a valid, in-gamut OKLCH value, so the CSS output above is safe to use directly.

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

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

Related Converters tools