CIE-Lab* to HEX Web Converter
Turn CIE-Lab* (D65) values into a web-ready HEX code. Out-of-gamut colors are flagged and clipped to the nearest displayable sRGB value in your browser.
Input
Result
#567FD8rgb(86, 127, 216)Technical Specification & Mathematical Principles
How the LAB to HEX Converter Works
The inverse pipeline starts from Lab: fy = (L* + 16) / 116, fx = fy + a* / 500, fz = fy - b* / 200. Each f value is cubed when the cube exceeds 216/24389, otherwise (116 f - 16) / 903.2963, then multiplied by the D65 white point to give XYZ.
XYZ is multiplied by the inverse sRGB matrix to obtain linear RGB, then gamma-encoded with 12.92 c or 1.055 c^(1/2.4) - 0.055. Many Lab colors, especially at high chroma, lie outside the sRGB gamut and produce linear channels below 0 or above 1. This tool flags that situation and clips each channel to the 0 to 1 range before encoding, which is the simplest and fastest fallback but may shift hue slightly.
Frequently Asked Questions
What does 'out of gamut' mean for a Lab color?
How does the clipping fallback work?
Why do my L*, a*, b* values round-trip exactly for in-gamut colors?
Related Design & Color Instruments
HEX to 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.
LAB to LCH Converter
Convert CIE-Lab to LCH(ab) cylindrical coordinates. Chroma is the square root of a squared plus b squared and hue is atan2(b, a). Free and client-side.
LCH to HEX Converter
Convert LCH(ab) lightness, chroma and hue to a HEX code. Pipeline: LCH to Lab to XYZ to linear sRGB with out-of-gamut detection and clipping fallback.
OKLCH to HEX Converter
Convert modern OKLCH coordinates back to sRGB hexadecimal strings with accurate gamut mapping.