LAB Color Converter

Lightness (L*)—
Green–red (a*)—
Blue–yellow (b*)—
Hex colour—

How LAB Color Converter is calculated: sRGB → linear → XYZ (D65) → cube-root → L* = 116f(Y) − 16, a* = 500(f(X) − f(Y)), b* = 200(f(Y) − f(Z)).

What is a LAB color converter?

A LAB color converter converts an RGB colour into CIELAB — L* for lightness, a* for green to red, and b* for blue to yellow — the colour model built to match how people actually see colour. Enter the red, green, and blue values, and it gives you the answer at once.

People use it for far more than curiosity. Colour scientists use it every day, because LAB is the model that matches human vision: equal steps in LAB look like equal steps to the eye, which is not true of RGB. Designers use it to measure how different two colours look, and anyone who has ever wondered why two colours that are close in RGB look far apart has needed LAB.

The converter runs in your browser and never sends anything anywhere. There is no reason for a simple conversion to collect personal information. Type the value, read the answer, and close the page — nothing is stored.

The answer is immediate and exact — there is no rounding in a time conversion, and the same input always gives the same answer. That is the difference between a converter and a calculator: nothing is estimated, and nothing is close enough.

How LAB colour works

LAB splits a colour into three parts. L* is the lightness, from 0 (black) to 100 (white) — the part that says how light or dark the colour is. a* is the green to red axis: negative is green, positive is red. b* is the blue to yellow axis: negative is blue, positive is yellow. A grey has an a* and b* of zero, whatever its lightness.

The lightness is the main figure: 53.2 for the default. The a* and b* say where the colour sits on the two axes — 80.1 towards red and 67.2 towards yellow for red — and the hex code is the same colour in the screen model.

The cube root is the heart of it. The eye does not see light linearly — a light that is twice as bright does not look twice as bright — and the cube root compresses the bright end and stretches the dark end, the way the eye does. That is why equal steps in LAB look like equal steps, and why LAB is the model used to measure colour difference.

The whole conversion is a few lines of arithmetic, and it runs in your browser, which is why the answer appears as you type. There is no server, no lookup table, and no database — just the rules of the two systems, applied to your input.

Lightness — the input that changes the answer

Lightness is the most important figure. An L* of 0 is black, 100 is white, and 50 is a mid grey — but a mid grey in LAB is not the same as an RGB value of 128. An RGB value of 128 is only about 22% as bright as white in linear light, so its L* is about 54, not 50. The sRGB curve is the reason.

The second input trap is the white point. LAB is measured against a white — D65, the standard for daylight — and a colour measured against a different white gives different numbers. The converter uses D65, which is the standard for screens, so the numbers match what most tools give.

The third trap is the sign. A positive a* is red and a negative a* is green; a positive b* is yellow and a negative b* is blue. A blue like #2563EB has a b* of −73.8 — strongly blue — and an a* of 31.0 — somewhat red — which is why it reads as a blue with a hint of purple.

The calculator checks the input as you type. A value that cannot be read — a missing marker, a minute above 59, a day that does not exist — is rejected with a message, instead of being guessed at. A converter that guesses is worse than one that says it does not know.

A worked example

First, the default on this page. Red (255, 0, 0) is L* 53.2, a* 80.1, b* 67.2. The lightness is 53.2 — a mid-lightness colour — the a* of 80.1 is strongly red, and the b* of 67.2 is strongly yellow, which together make the red we see. The hex is #FF0000.

Second, white: (255, 255, 255) is L* 100, a* 0, b* 0. White is the lightest colour there is, and it has no hue at all — the a* and b* are both zero, which is the definition of a grey. The hex is #FFFFFF.

Third, a blue: (37, 99, 235) is L* 46.1, a* 31.0, b* −73.8. The lightness is 46.1 — a little darker than red — the a* of 31.0 is somewhat red, and the b* of −73.8 is strongly blue. The hex is #2563EB, and the negative b* is what makes it a blue.

Every example above uses the same rules, and you can check each one by hand. The arithmetic is short enough to do on paper, which is the point — a converter you can verify is a converter you can trust.

Why it matters, and who uses it

Colour scientists use it to measure colour difference. The distance between two colours in LAB — called Delta E — is a number that says how different they look to the eye, and it is used to check whether a print matches a screen, or whether two batches of paint are the same colour.

Designers use it for accessible colour. Two colours that are far apart in LAB are easy to tell apart, and two that are close are hard — which is why LAB is the model behind contrast checks and colour-blindness simulations. The converter gives the LAB values, and the designer judges the distance.

Then there is the plain usefulness of an exact answer. Knowing that red is L* 53.2, a* 80.1, b* 67.2 — and that a blue is L* 46.1, a* 31.0, b* −73.8 — is a small piece of knowledge that puts colour on a scale the eye understands, and it is exact, not an estimate.

The answer is also easy to check, which is the point of showing the working. Pick a value you know — midnight, noon, half an hour — and the figures should match what you remember. If they do, the converter is working.

LAB Color Converter vs RGB to HEX converter

These two tools answer different questions. An RGB to HEX converter changes a colour between two ways of writing the same RGB values — (255, 0, 0) and #FF0000 are the same colour, written differently. This converter changes a colour into LAB — lightness, green-red, and blue-yellow — which is a different way of thinking about the colour, built to match how people see it. The difference is what is being converted: a notation, or a model. If the question is 'what is (255, 0, 0) as a hex code', the RGB to HEX converter is the tool; if the question is 'how light is this red, and how red is it', this is the tool.

If the question is 'how light is this red', use this converter. If the question is 'what is (255, 0, 0) as a hex code', use the RGB to HEX converter instead. Use this converter for lightness and colour difference, and the RGB to HEX converter for hex codes. If the question is what a colour looks like, a color picker shows it on screen.

Both are the same kind of tool — a value in, a value out, worked out in your browser. A color picker shows any colour on screen and gives its hex code, which is the tool to use when you want to see the colour rather than convert it. And a HEX to RGB converter turns a hex code into RGB values, which is the tool to use when the colour is given as a hex code.

The two tools share the same idea: a value in, a value out, worked out in your browser. The difference is only in what is being converted, and in which direction the answer points.

Common mistakes

The first mistake is the lightness. An L* of 50 is not an RGB value of 128 — an RGB value of 128 is only about 22% as bright as white in linear light, so its L* is about 54. The sRGB curve is the reason, and the converter applies it.

Second: the signs. A positive a* is red and a negative a* is green; a positive b* is yellow and a negative b* is blue — and swapping them turns a blue into a yellow. Third: the white point — LAB is measured against D65 daylight, and a different white gives different numbers.

Fourth: the gamut. Not every LAB value is a colour a screen can show — an L* of 50 with an a* of 150 is outside the sRGB gamut, and no RGB values can make it. The converter only goes from RGB to LAB, so every result is a colour a screen can show.

The mistakes above are the ones people actually make, and they are all small. A converter that shows its working lets you catch them before they matter, which is the whole reason for using one.

How to use this LAB color converter

Using it takes seconds. Enter the red, green, and blue values — the default is red (255, 0, 0). The results update live: the lightness L*, the green-red a*, the blue-yellow b*, and the hex code. The results update live as you type.

The lightness is the main figure: 53.2 for the default. The a* and b* say where the colour sits on the two axes — 80.1 towards red and 67.2 towards yellow for red — and the hex code is the same colour in the screen model.

Everything runs in your browser, so nothing you enter leaves your device. One practical tip: compare two colours by their LAB distance, not by their RGB values. Two colours that are 10 apart in RGB can look identical, and two that are 100 apart can look the same — but in LAB, the distance is the difference you see.

Everything runs in your browser, so nothing you enter leaves your device, and the answer is the same every time you enter the same value. There is nothing to save, nothing to sign up for, and nothing to wait for.

Frequently Asked Questions

L* 53.2, a* 80.1, b* 67.2. The lightness is 53.2, the a* of 80.1 is strongly red, and the b* of 67.2 is strongly yellow. The RGB values are (255, 0, 0) and the hex code is #FF0000.

L* is the lightness, from 0 (black) to 100 (white). a* is the green to red axis: negative is green, positive is red. b* is the blue to yellow axis: negative is blue, positive is yellow. A grey has an a* and b* of zero.

Because equal steps in LAB look like equal steps to the eye, which is not true of RGB. Two colours that are 10 apart in RGB can look identical, and two that are 100 apart can look the same — but in LAB, the distance is the difference you see.

D65, the standard for daylight. LAB is measured against a white, and the converter uses D65, which is the standard for screens — so the numbers match what most colour tools give.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.