RGB to LAB Converter
Enter an sRGB hex color to convert it to CIELAB (D65) values.
Result
How it is calculated
The tool reads a six-digit sRGB hex code (a leading # is optional, and a three-digit shorthand such as f00 is expanded). Each channel is divided by 255, then linearized: c/12.92 for small values, otherwise ((c+0.055)/1.055)2.4. The linear values are multiplied by the sRGB matrix to get X, Y, Z and divided by the D65 white (95.047, 100, 108.883). Then L* = 116·f(Y) − 16, a* = 500·(f(X) − f(Y)) and b* = 200·(f(Y) − f(Z)), where f(t) is the cube root of t above 0.008856 and a linear segment below it. Results are rounded to two decimals. Any input that is not a valid 3 or 6 digit hex code gives no result.
Worked example
Take the colour 1E6BFF. The channels are 30, 107 and 255, which linearize to about 1.30, 14.70 and 100.00 percent. The matrix gives X ≈ 23.84, Y ≈ 18.01, Z ≈ 96.83. After dividing by the D65 white and applying the cube root, L* = 116 × 0.565 − 16 ≈ 49.5. The tool shows 49.51 32.97 -79.38: moderately light (L*), pushed toward magenta-red (a* positive) and strongly toward blue (b* very negative).
Common mistakes
- Typing RGB decimals such as 30,107,255 into the box. It expects one hex code, not three separate numbers.
- Treating L* as a 0 to 255 brightness. It runs from 0 (black) to 100 (white), so a mid blue near 50 is normal.
- Comparing results with a LAB value measured against D50 (common in print profiles). This tool uses D65, so the numbers will not match.
- Assuming a* and b* are 0 to 100 as well. They are signed: negative a* is greenish, positive is reddish, negative b* is bluish, positive is yellowish.
- Expecting pure white to give exactly 0 and 0 for a* and b*. The result shows tiny residuals of about 0.01 because of rounding in the matrix constants.
About this calculator
CIELAB (L*a*b*) is a color space designed to be perceptually uniform — equal numeric distances in L*a*b* correspond much more closely to equal perceived color differences than equal distances in RGB do, which is why it's the standard space for measuring how different two colors actually look to the human eye. Converting sRGB to LAB requires first linearizing and transforming the RGB values into the CIE XYZ color space, then applying the nonlinear XYZ-to-LAB transformation referenced against a chosen white point — here, the common D65 standard illuminant that approximates average daylight.
This calculator runs an sRGB hex color through that full pipeline to produce its L*, a*, and b* coordinates. It's used in color science, print production, and quality control, where LAB values feed into calculating a precise color-difference metric (Delta E) between a target color and a printed or manufactured sample — something RGB or hex values alone can't reliably measure.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
To compare two colours, run each hex code and take the straight-line distance: the square root of the squared differences in L*, a* and b*. This is the simple CIE76 version of Delta E. Greys 808080 and 828282 give L* of 53.59 and 54.37, a distance of about 0.78, which most people cannot see side by side. Quality-control standards often use the more elaborate CIEDE2000, which this plain distance only approximates. Which two colours are you trying to tell apart?