Lab to HEX and RGB converter
Handy when you receive Lab values from a spectrophotometer or a color guide and need a color for screen or CSS.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter lightness l*, a* axis, b* axis and reference white.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
fy = (L* + 16) / 116, fx = fy + a*/500, fz = fy − b*/200, then X = Xn fx³ (or (116 fx − 16)/(24389/27) when fx³ ≤ 216/24389), same for Y and Z. XYZ is then turned into linear RGB with the inverse sRGB matrix. Linear RGB is then encoded per IEC 61966-2-1: 12.92 l if l ≤ 0.0031308, else 1.055 l^(1/2.4) − 0.055, times 255 and rounded.
Example
Inputs: Lightness L* = 60.18, a* axis = 62.06, b* axis = 54.33, Reference white = D65 daylight, no adaptation (sRGB white). Result: HEX code: #FF5733; Gamut status: Inside the sRGB gamut.
Limits and caveats
- Colors outside sRGB have their channels clipped to 0-255, which shifts the displayed color.
- HEX and RGB are assumed to be sRGB; Display P3 or Adobe RGB colors need their own ICC profile.
Questions about this tool
Why does it say the color is out of gamut?
Lab covers more colors than sRGB, so some combinations cannot be shown on an sRGB screen. The tool clips the channels to 0-255 and tells you.
My Lab values come from Photoshop. Which white should I use?
Pick D50, since Photoshop Lab mode and ICC profiles are based on the D50 white.
Does the round trip give the same HEX back?
Yes, if you enter the Lab values of a HEX color to at least 2 decimals, rounding to 8 bits returns the same color.
