Lab to OKLab Converter

Converted OKLab Output --
100%

Wide-Gamut & Linear Formats

Modern CSS color space notations derived from this color

Contrast Analysis (WCAG 2.1)

Checks the converted color against foreground or background targets for accessibility compliance.

How to Convert CIELAB to OKLab

Converting CIELAB (Lab) to OKLab is an upgrade from a 1970s perceptual color model to a modern, highly optimized one. Both spaces use the same L, a, and b axes, but OKLab calculates them using better math.

Why Upgrade to OKLab?

CIELAB was a massive achievement when it was introduced in 1976, but it has known flaws. The most prominent is the "blue shift." When transitioning from blue to white in CIELAB, the color shifts toward purple. It also struggles to maintain consistent perceived saturation across different hues.

OKLab was created in 2020 to fix these specific issues. It uses LMS (Long, Medium, Short) cone responses to better simulate how the human eye processes light. Gradients and color mixing done in OKLab are smooth, hue-stable, and free of the purple shift.

The Conversion Pipeline

You cannot map CIELAB coordinates directly to OKLab coordinates. The color must be translated back into a linear light space first.

  1. Convert CIELAB to the CIE XYZ reference space (using a D50 white point).
  2. Convert XYZ to Linear sRGB.
  3. Multiply the Linear sRGB values by the OKLab transformation matrix to enter LMS cone space.
  4. Apply the OKLab non-linear curve and final matrix to get the new L, a, and b values.

Related Tools