GamutDesk Logo
GamutDesk

HEX to CIE-Lab* Converter

Convert any HEX color to CIE-Lab* (D65) instantly. See L*, a*, b* values, the CSS lab() function, and the full sRGB to XYZ to Lab math in your browser.

Client-Side ArchitecturePrivate Client-Side Processing

Input

Result

L*55.63
a*17.54
b*-64.42
Lab (D65)55.63, 17.54, -64.42
CSS lab()lab(55.6% 17.5 -64.4)

Technical Specification & Mathematical Principles

How the HEX to LAB Converter Works

The conversion runs three stages. First each sRGB channel is linearized by removing the gamma curve: c_lin = c / 12.92 when c <= 0.04045, otherwise ((c + 0.055) / 1.055)^2.4. Second, the linear triple is multiplied by the sRGB to XYZ matrix for the D65 white point (X = 0.4124564 R + 0.3575761 G + 0.1804375 B, and so on for Y and Z).

Third, XYZ is normalized by the D65 reference white (Xn = 95.047, Yn = 100, Zn = 108.883) and passed through the CIE function f(t) = t^(1/3) for t > 216/24389, or (903.2963 t + 16) / 116 otherwise. Then L* = 116 f(Y/Yn) - 16, a* = 500 (f(X/Xn) - f(Y/Yn)) and b* = 200 (f(Y/Yn) - f(Z/Zn)).

Frequently Asked Questions

What is CIE-Lab* and why is it called perceptually based?
CIE-Lab* is a color space standardized by the CIE in 1976 where L* is lightness from 0 to 100, a* runs from green (negative) to red (positive) and b* runs from blue (negative) to yellow (positive). Equal numeric distances correspond roughly to equal perceived differences, which RGB does not offer.
Which white point does this converter use?
It uses the D65 standard illuminant (daylight, about 6504 K), the reference white of sRGB. Lab values calculated against D50, as used by ICC print profiles, differ slightly because they require a chromatic adaptation step.
Can I use the result directly in CSS?
Yes. Modern browsers support the lab() function from CSS Color 4. Note that CSS lab() uses a D50 white point, so the copyable lab() string on this page is for reference and the L*, a*, b* readouts are D65.

Related Design & Color Instruments