RGB to Lab converter
Useful when your color comes as RGB numbers from a design app or a camera and you need its Lab equivalent.
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 red r, green g, blue b 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
Each channel c (0 to 1) is linearised per IEC 61966-2-1: c / 12.92 if c ≤ 0.04045, otherwise ((c + 0.055) / 1.055)^2.4. X = 0.41239R + 0.35758G + 0.18048B, Y = 0.21264R + 0.71517G + 0.07219B, Z = 0.01933R + 0.11919G + 0.95053B (matrix derived from the sRGB primaries and D65 white). L* = 116 f(Y/Yn) − 16, a* = 500 (f(X/Xn) − f(Y/Yn)), b* = 200 (f(Y/Yn) − f(Z/Zn)), with f(t) = ∛t if t > 216/24389, else (24389/27 t + 16) / 116. For D50, XYZ is adapted from D65 to D50 with the Bradford matrix first.
Example
Inputs: Red R = 255, Green G = 87, Blue B = 51, Reference white = D65 daylight, no adaptation (sRGB white). Result: Lab values: L* 60.18, a* 62.06, b* 54.33; Lightness L*: 60.1758; a* (green to red): 62.0605.
Limits and caveats
- HEX and RGB are assumed to be sRGB; Display P3 or Adobe RGB colors need their own ICC profile.
- Accepts whole numbers from 0 to 255 per channel (8-bit).
Questions about this tool
What range does L* cover?
From 0 for black to 100 for the reference white. Gray 128 gives about L* 53.6 because perceived lightness is not linear.
Is Lab device independent?
Lab describes color relative to a reference white, so you still need to know the source RGB space. This tool assumes sRGB.
Can I enter decimal values?
No, it takes 8-bit whole numbers. If your values run from 0 to 1, multiply them by 255 first.
