LAB to HEX Converter
Convert a CIE LAB color (D65 illuminant) to HEX and RGB, right in your browser.
0 = black, 100 = white
negative = green, positive = red
negative = blue, positive = yellow
#ff0000rgb(255, 0, 0)lab(53.24 80.09 67.20)How LAB to HEX conversion works
CIE LAB (also written CIELAB or L*a*b*) is a perceptually uniform color space where L represents lightness (0–100), a represents the green–red axis, and brepresents the blue–yellow axis. Because LAB is device-independent, converting it to HEX requires an intermediate step: LAB is first converted to CIE XYZ using the D65 standard illuminant (the same white point used by sRGB and most displays), and the resulting XYZ values are then transformed into linear sRGB via the standard primaries matrix, gamma-encoded, and rounded to 8-bit RGB channels. Because LAB can describe colors outside the sRGB gamut (colors monitors can't physically display), some LAB inputs will produce a clamped, closest-match HEX value — this tool flags those cases.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Converting a perceptually defined colour into a hex value for the web.
- Producing a hex fallback for a palette built in LAB.
- Comparing two colours' perceptual difference before picking hex values.
- Translating a colour-science specification into something a browser accepts.
- Building an evenly spaced palette in LAB and exporting it as hex.
Frequently Asked Questions
- What makes CIELAB different from RGB or HSL?
- It is perceptually uniform by design — a fixed numerical distance corresponds to roughly the same perceived difference anywhere in the space. RGB and HSL are device coordinates, so the same numeric step is a large change in one region and invisible in another.
- What do L, a and b represent?
- L is lightness from 0 (black) to 100 (white). `a` runs green-to-red and `b` blue-to-yellow, both roughly −128 to +127 with 0 as neutral. The two opponent axes come from how human colour vision actually encodes signal after the cone responses.
- Why does the conversion go through XYZ?
- Because LAB is defined relative to a reference white in the CIE XYZ space, not directly against RGB. The path is LAB → XYZ using the piecewise cube-root function, then XYZ → linear RGB by matrix, then gamma encoding to sRGB. Each step is a published transform.
- What is the D65 white point?
- The standard daylight illuminant, roughly 6504K, and the white sRGB itself is defined against — X 95.047, Y 100, Z 108.883 for the 2° observer. Converting against a different illuminant such as D50, which print workflows use, shifts every resulting colour.
- Why do some LAB values produce no valid hex?
- Because LAB can describe colours outside the sRGB gamut — it covers everything visible, and sRGB covers a subset. Those values clip to the gamut boundary when converted, so several distinct LAB colours can map to the same hex and the conversion stops being reversible.
Common errors and gotchas
- Assuming every LAB colour is displayable. The space is much larger than sRGB, so many values must be clipped.
- Ignoring the illuminant, since a LAB value means different things under D50 and D65.
- Reading LAB lightness as HSL's, which are defined differently and not comparable.
- Round-tripping through 8-bit hex repeatedly, which loses the precision LAB was chosen for.
- Treating clipped output as a conversion error rather than a gamut limit.