GamutDesk Logo
GamutDesk

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.

Client-Side ArchitecturePrivate Client-Side Processing

Input

Result

HEX#567FD8
RGBrgb(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?
Lab can describe every color a human sees, but a screen can only show the triangle of colors spanned by its sRGB primaries. A Lab value outside that triangle has a negative or greater-than-one linear RGB channel, so it has no exact HEX equivalent.
How does the clipping fallback work?
Each linear RGB channel is clamped to the 0 to 1 range, then encoded to 8 bits. It is deterministic and fast, but it can change the hue and lightness of saturated colors, so the page shows a warning whenever clipping happened.
Why do my L*, a*, b* values round-trip exactly for in-gamut colors?
The converter uses the exact CIE constants (epsilon 216/24389 and kappa 24389/27) and full-precision sRGB matrices, so converting an 8-bit color to Lab and back returns the same HEX.

Related Design & Color Instruments