CIE L*a*b* to RGB Color Converter

Convert CIELAB perceptual colors back to sRGB

Free CIELAB to RGB converter. Enter L*, a*, and b* values under the D65 white point and get the equivalent sRGB color, hex code, and swatch, with an out-of-gamut warning. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does Lab convert back to RGB?

The Lab values are run through the inverse CIELAB function to recover XYZ relative to the D65 white, multiplied by the XYZ-to-linear-sRGB matrix, then gamma-encoded and scaled to 0-255 to produce the displayable RGB color.

Convert a CIE L*a*b* color back into a displayable sRGB value, with the matching hex code and a live swatch. This reverses the RGB-to-Lab pipeline, so you can take perceptually-defined colors and turn them into something a screen can show.

Why convert Lab to RGB?

CIELAB is the color space designers and color scientists use when they need perceptual uniformity — equal numeric distances look equal to human eyes. It is used in color palette generation, image difference metrics (Delta-E), accessibility contrast tools, and CSS lab(). But monitors speak sRGB. This converter bridges that gap: you define a color perceptually in Lab, then get the closest sRGB representation your screen can actually show.

How it works

The conversion runs the RGB-to-Lab steps in reverse:

  1. Lab to XYZ — recover the intermediate f values, then invert the nonlinearity (cube where above the threshold, linear segment below) and multiply by the D65 white:
fy = (L* + 16) / 116
fx = fy + a*/500
fz = fy - b*/200
X = Xn * finv(fx)   Y = Yn * finv(fy)   Z = Zn * finv(fz)
  1. XYZ to linear sRGB with the inverse matrix:
r =  3.2406*X - 1.5372*Y - 0.4986*Z
g = -0.9689*X + 1.8758*Y + 0.0415*Z
b =  0.0557*X - 0.2040*Y + 1.0570*Z
  1. Gamma encode each linear channel and scale to 0–255:
c <= 0.0031308 ? 12.92*c : 1.055*c^(1/2.4) - 0.055

If any channel lands outside 0–255 the color is out of sRGB gamut; it is clamped and flagged.

What the axes mean

  • L* (0–100) — perceptual lightness. 0 is absolute black, 100 is the reference white. Doubling L* roughly doubles perceived brightness, unlike RGB where doubling a value does not.
  • a* — green (negative) to red (positive). Neutral grays sit near zero.
  • b* — blue (negative) to yellow (positive). Neutral grays also sit near zero.

Colors that are neutral (grey, white, black) always have a* and b* close to zero. Vivid, saturated colors push a* and b* to larger absolute values, and those high-chroma Lab colors are the ones most likely to fall outside the sRGB gamut.

Example

lab(55.6% 17.6 -64.4) converts back to approximately rgb(59, 130, 246)#3B82F6.

For comparison, lab(0 0 0)#000000 black, and lab(100 0 0)#FFFFFF white. The conversion is most accurate in the middle of the sRGB gamut where clamping is not needed.

Out-of-gamut colors

The D65 white point is assumed, matching sRGB and CSS lab(). When Lab describes a color that no sRGB monitor can reproduce — typically highly saturated cyan-greens and some vivid blues — the RGB channels go outside 0–255. The converter clamps them to the nearest in-gamut value and flags the result so you know the displayed swatch is an approximation. If you need to show the exact color, consider a wide-gamut display mode (P3 or Rec. 2020) and CSS color() or oklch() instead of sRGB hex. All math runs in your browser — nothing is uploaded.