📊 RGB to OKLCH Converter
Convert rgb() values into oklch() — the perceptually uniform format — with OKLAB, LAB and HEX shown alongside.
#1d87f1
oklch(62.3% 0.1828 253.6)oklab(62.3% -0.0517 -0.1753)lab(56.02 10.09 -61.05)lch(56.02 61.88 279.4)hwb(210 11% 5%)#1d87f1rgb(29, 135, 241)hsl(210, 88%, 53%)Exact OKLab matrices (Björn Ottosson) + CIE XYZ/LAB (D65). Out-of-gamut OKLCH colors are chroma-mapped along constant L and H. 🔒 Computed in your browser.
How the rgb to oklch converter works
Each RGB channel is linearised from sRGB and passed through the exact OKLab matrices, then written as oklch(L% C H). The page also shows OKLAB, CIELAB, LCH, HWB and the HEX form of the same color.
RGB and OKLCH describe the same color, but OKLCH separates lightness from hue and chroma perceptually — so once in OKLCH you can lighten or shift hue without the muddiness that RGB and HSL edits produce.
Frequently asked questions
How do I convert RGB to OKLCH?
Enter the red, green and blue values (0–255); the tool linearises them and applies the OKLab transform to give an oklch() value, plus OKLAB and LAB.
Is RGB to OKLCH exact?
Yes — it uses the published OKLab matrices, so the result matches the oklch() a browser computes from the same RGB color.
Why use OKLCH instead of RGB?
RGB is how screens emit color but is not intuitive to edit; OKLCH is perceptually uniform, so lightness and hue adjustments look even. It is the modern CSS authoring format.
Does it show a HEX version too?
Yes — the HEX equivalent is shown next to the OKLCH, OKLAB and LAB values.
Is my color uploaded?
No — every conversion runs in your browser.