HEX to LAB Converter
Convert a HEX color to CIE LAB (L*a*b*, D65 illuminant) with a live preview.
How HEX to LAB conversion works
CIE L*a*b* (often written LAB) is a color space designed to be perceptually uniform — equal numeric distances between two LAB colors correspond much more closely to equal perceived differences than RGB or HEX do. That makes it the standard choice for color-difference calculations (Delta E), print/design color matching, and image-processing pipelines.
This tool converts your HEX color to sRGB, removes the sRGB gamma curve to get linear RGB, transforms it to CIE XYZ using the D65 standard illuminant, and finally derives L* (lightness), a* (green–red axis) and b* (blue–yellow axis) using the standard CIE 15:2004 formulas — entirely in your browser.
Need a different color space? Try HEX to HSL, HEX to CMYK, or the all-in-one color converter.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Getting perceptual coordinates for a colour to compare it properly.
- Measuring the perceptual distance between two brand colours.
- Producing a LAB value for a colour-science calculation.
- Building an evenly spaced palette from a starting hex.
- Producing CSS `lab()` output alongside the hex.
Frequently Asked Questions
- Why convert a hex colour to LAB at all?
- To measure colour difference meaningfully. RGB distance does not match perception — a numerically small change in blue is invisible while the same change in green is obvious. LAB was built so that equal distances look equally different, which is what makes ΔE a usable metric.
- What is ΔE and what counts as a match?
- The distance between two colours in LAB. The rough scale: under 1 is imperceptible to most people, 1–2 needs a trained eye, 2–10 is noticeable, above 10 is obviously different. Print and manufacturing tolerances are usually specified as a ΔE ceiling.
- What do the three numbers mean?
- L is lightness, 0 to 100. `a` runs green-negative to red-positive and `b` blue-negative to yellow-positive, both roughly −128 to +127. The opponent axes come from how human vision encodes colour after the cone responses, not from any display technology.
- Why does the conversion need a white point?
- Because LAB describes colour relative to an illuminant, so the same XYZ values give different LAB numbers under D50 and D65. sRGB is defined against D65, which is why that is the default — a print workflow using D50 gets legitimately different results.
- Is every LAB value a real colour?
- No. LAB spans everything visible and more besides, so many valid LAB triples fall outside sRGB and have no hex equivalent. Converting one clips it to the gamut edge, which is why several distinct LAB colours can map to the same hex.
Common errors and gotchas
- Feeding a hex from an untagged image, whose real colour space was never sRGB to begin with.
- Expecting the a and b axes to map onto hue and saturation, which they deliberately do not.
- Assuming every LAB value converts back to a displayable colour.
- Comparing LAB distances as if all directions were equally perceptible, which is only approximately true.
- Round-tripping through 8-bit hex, which discards the precision LAB was chosen for.