RGB to Lab Converter

RGB in, CIE Lab out — with the working shown.

To convert RGB to Lab, normalise the input, linearise the channels, move into the perceptual space, then check the gamut. For example, rgb(47 129 247) in RGB is lab(55.09% 17.34 -65.86) in Lab.

This is a free RGB to Lab converter. Type or paste any red, green and blue channel values into the field above and the Lab value updates as you type, along with every other notation the web understands. Lab is a device-independent, perceptually organized space with a lightness axis and two opponent color axes.

Conversions run entirely in your browser using the same color engine as the rest of the site: values round-trip through linear sRGB and CIE XYZ rather than through an approximation, so what you copy is accurate to the last digit the format can carry.

How to convert RGB to Lab

  1. Normalise the input. Read the RGB value and scale each component into the 0–1 range the maths expects.
  2. Linearise the channels. Undo the sRGB gamma curve, because the encoded 0–255 numbers are not proportional to light and averaging them directly is what makes gradients go muddy.
  3. Move into the perceptual space. Convert linear RGB to CIE XYZ under a D65 white point, then apply the Lab transfer function.
  4. Check the gamut. Clamp anything that falls outside what an sRGB display can show, so the value you copy is the value you get.

Worked example: rgb(47 129 247) converts to lab(55.09% 17.34 -65.86). That color is Dodger Blue, and the tool above shows each intermediate step for whatever value you enter.

Common RGB to Lab values

The twenty colors people look up most often, converted from RGB to Lab. Every row is computed by the same engine as the tool above.

ColorRGBLab
Whitergb(255 255 255)lab(100% 0 0)
Blackrgb(0 0 0)lab(0% 0 0)
Redrgb(255 0 0)lab(53.24% 80.09 67.2)
Limergb(0 255 0)lab(87.73% -86.18 83.18)
Bluergb(0 0 255)lab(32.3% 79.19 -107.86)
Yellowrgb(255 255 0)lab(97.14% -21.55 94.48)
Cyanrgb(0 255 255)lab(91.11% -48.09 -14.13)
Magentargb(255 0 255)lab(60.32% 98.23 -60.82)
Silverrgb(192 192 192)lab(77.7% 0 0)
Grayrgb(128 128 128)lab(53.59% 0 0)
Maroonrgb(128 0 0)lab(25.54% 48.05 38.06)
Olivergb(128 128 0)lab(51.87% -12.93 56.67)
Greenrgb(0 128 0)lab(46.23% -51.7 49.9)
Purplergb(128 0 128)lab(29.78% 58.93 -36.49)
Tealrgb(0 128 128)lab(48.25% -28.85 -8.48)
Navyrgb(0 0 128)lab(12.97% 47.5 -64.7)
Orangergb(255 165 0)lab(74.94% 23.93 78.95)
Pinkrgb(255 192 203)lab(83.59% 24.14 3.33)
Goldrgb(255 215 0)lab(86.93% -1.92 87.13)
Crimsonrgb(220 20 60)lab(47.04% 70.92 33.6)

RGB and Lab, briefly

RGB is three channels from 0 to 255 describing how hard the display drives its red, green and blue subpixels. Valid range: 0–255 per channel.

Lab is a device-independent, perceptually organized space with a lightness axis and two opponent color axes. Valid range: L 0–100, a and b roughly −128 to 127.

Frequently asked questions

How do you convert RGB to Lab?

1. Read the RGB value and scale each component into the 0–1 range the maths expects. 2. Undo the sRGB gamma curve, because the encoded 0–255 numbers are not proportional to light and averaging them directly is what makes gradients go muddy. 3. Convert linear RGB to CIE XYZ under a D65 white point, then apply the Lab transfer function. 4. Clamp anything that falls outside what an sRGB display can show, so the value you copy is the value you get. The converter on this page does all of it as you type, and shows the working underneath.

What is rgb(255 0 0) in Lab?

Pure red, rgb(255 0 0), is lab(53.24% 80.09 67.2) in Lab. There is a table of twenty common colors converted to Lab further up this page.

What is rgb(47 129 247) in Lab?

rgb(47 129 247) converts to lab(55.09% 17.34 -65.86). It is a dodger blue, and you can paste any other value into the field at the top of the page to convert it.

Is RGB to Lab conversion lossless?

Within sRGB, yes — converting to Lab and back returns the value you started with. The only rounding happens when a component is written out to a fixed number of decimal places.

Can I use Lab directly in CSS?

Yes. lab(55.09% 17.34 -65.86) is valid CSS and works in every current browser.

Does this RGB to Lab converter support transparency?

Alpha is preserved wherever the target notation can carry it — eight-digit hex, rgb() / a, hsl() / a and the modern CSS spaces all round-trip an alpha channel. CMYK has no alpha, so it is dropped there.

Is my color data sent anywhere?

No. Every conversion on this site runs in your browser with no network request, no account and no analytics. You can disconnect and it keeps working.