RGBA to LAB Converter

Enter RGBA values (0–255) and instantly see the CIE LAB (L*, a*, b*) result with intermediate XYZ values and a color preview swatch.

RGBA Input

255
0
0
255
rgba(255, 0, 0, 255)

CIE LAB Output

Alpha: 255 / 255 (100.0%) — passed through, does not affect L*a*b*

Conversion Pipeline

  1. 1 sRGB gamma decode (linearize): Rl=1.0000, Gl=0.0000, Bl=0.0000
  2. 2 Linear RGB → XYZ (D65 matrix): X=0.4125, Y=0.2126, Z=0.0193
  3. 3 Normalize by D65 white (Xn=0.95047, Yn=1.00000, Zn=1.08883): X/Xn=0.4340, Y/Yn=0.2126, Z/Zn=0.0178
  4. 4 XYZ → CIE LAB: lab(53.23 80.11 67.22)
Copied!

Summary

Enter RGBA values (0–255) and instantly see the CIE LAB (L*, a*, b*) result with intermediate XYZ values and a color preview swatch.

How it works

  1. Enter R, G, B values (0–255) and Alpha (0–255) in the input fields or drag the sliders.
  2. Each RGB channel is linearized by reversing the sRGB gamma curve: values ≤ 0.04045 are divided by 12.92; values above that use ((v + 0.055) / 1.055)^2.4.
  3. The three linear-light values are multiplied by the standard sRGB-to-XYZ D65 matrix to produce X, Y, Z tristimulus values.
  4. XYZ is normalized against the D65 reference white (Xn=0.95047, Yn=1.00000, Zn=1.08883) and passed through the CIE f() function (cube root or linear segment).
  5. L*, a*, and b* are computed as: L*=116·f(Y/Yn)−16, a*=500·(f(X/Xn)−f(Y/Yn)), b*=200·(f(Y/Yn)−f(Z/Zn)).
  6. The color swatch previews the RGB color at the specified alpha. Alpha passes through unchanged and is shown separately.

Use cases

  • Convert screen or CSS RGBA colors to CIE LAB for perceptual color analysis.
  • Compute color-difference (ΔE) inputs from RGBA values used in design tools.
  • Cross-reference colors between sRGB display space and device-independent LAB.
  • Inspect the intermediate XYZ values for ICC profile or color management work.
  • Generate lab() CSS Color Level 4 values from existing rgba() color strings.
  • Validate RGBA → LAB conversions when implementing color science algorithms.
  • Check perceptual lightness (L*) and chroma axes (a*, b*) for any RGBA color.
  • Build perceptual color palettes by comparing L* values across RGBA swatches.

Frequently Asked Questions

Last updated: 2026-07-01 · Reviewed by Nham Vu