Search tools

Find a tool by name or what it does.

RGB to LAB Converter

Convert RGB colors to CIELAB L, a and b values, with a CSS lab() string and an optional XYZ readout.

RGB or HEX, or drag the sliders. Everything runs in your browser. Nothing is uploaded.

Channels

CIELAB result

50.1
L. Lightness (0 to 100)
38.69
a. Green to red axis
-70.49
b. Blue to yellow axis
LABL: 50.1, a: 38.69, b: -70.49
CSSlab(49.05% 30.35 -71.87)

How to convert RGB to LAB online

  1. Enter a color

    Type an RGB or HEX value, drag the red, green and blue sliders, or use the visual picker.

  2. Read the LAB values

    The L, a and b values, the CSS lab() string, and the swatch update instantly as the color changes.

  3. Copy the result

    Copy the plain Lab values, the CSS lab() string, or the XYZ readout with one click.

Why use this tool

Standard CIELAB math

Channels are linearized, converted to CIE XYZ against the D65 reference white, then to L, a and b with the standard cube-root formula.

Ready-to-paste CSS lab() string

The CSS value is adapted to the D50 white point that stylesheets expect, so it matches what browsers actually render.

Optional XYZ readout

Toggle a CIE XYZ readout scaled 0 to 100 for print, color science and graphics workflows.

Sliders, picker and paste

Set the color with per-channel RGB sliders, a visual picker, or by pasting HEX, RGB or RGBA values in any common notation.

Runs entirely in your browser

Every conversion happens on your device; nothing is uploaded or stored.

About this tool

CIELAB (often written Lab) describes color the way people perceive it rather than the way screens emit it. L is lightness from 0 (black) to 100 (white), a runs from green (negative) to red (positive), and b runs from blue (negative) to yellow (positive). Because equal distances in Lab correspond roughly to equal perceived differences, it is the space of choice for measuring color difference, matching brand colors across materials, and print production.

This converter takes an RGB color from sliders, a visual picker, or a pasted HEX, RGB or RGBA string, undoes the sRGB gamma curve, converts the linear channels to CIE XYZ using the D65 reference white, and then applies the standard CIELAB formula with the correct cube-root and linear split for very dark colors. Out-of-range channel values are clamped to 0 to 255, and alpha is ignored since Lab describes an opaque color. An optional readout shows the intermediate XYZ values scaled 0 to 100.

The CSS row is a ready-to-paste lab() value. Stylesheets define lab() relative to the D50 white point, so the tool chromatically adapts the color before building that string, which is why its numbers differ slightly from the D65 cards above it. For related conversions, try the HEX to OKLCH converter for the newer perceptual CSS space, or the RGB to HSV converter for a screen-oriented model.

Frequently asked questions

How does the RGB to LAB conversion work?
The RGB channels are first linearized by undoing the sRGB gamma curve, then converted to CIE XYZ using the D65 reference white, and finally to CIELAB with the standard formula, including the cube-root and linear split that keeps very dark colors accurate.
Why do my LAB values differ slightly from other tools?
Almost always the white point. This tool reports Lab relative to D65, which matches most screen workflows, while the CSS lab() string is adapted to D50 as the CSS specification requires. Tools that pick a different reference white or round earlier will show slightly different numbers.
What ranges do L, a and b use?
L runs from 0 (black) to 100 (white). The a and b axes are unbounded in theory, but colors that a screen can show stay roughly between -128 and 127. Positive a leans red, negative a leans green, positive b leans yellow, and negative b leans blue.
Which input formats are accepted?
HEX in 3, 4, 6 or 8 digit form (with or without #), plus rgb() and rgba() with comma or space separators and optional percentages. Alpha is ignored because Lab describes an opaque color, and out-of-range channels are clamped to 0 to 255.
Is my color data uploaded anywhere?
No. Everything runs in your browser; nothing is sent to a server.

Related tools