RGB to XYZ Converter

Free, accurate, and instant conversion. Preview your color in real-time on digital and print mockups.

Source Input RGB

0
0
0
Converted Result
White TextAAA (Excellent)
xyz(0, 0, 0)
Digital
Print Check
Design Studio
Jane Doe
Color Nameblack
HEX
#000000
RGB
0, 0, 0
HSL
0°, 0%, 0%
CMYK
0, 0, 0, 100
Ready-to-use Code
/* CSS Variable */
--color-primary: #000000;

/* Standard */
color: #000000;
background-color: #000000;

The Master Space: RGB to CIE XYZ

Welcome to 1931. Before pixels existed, scientists at the CIE (Commission Internationale de l'Éclairage) mapped the human eye's response to light. The result was XYZ—a color space that doesn't describe "how much red ink" or "how much green light", but rather how the human brain perceives color.

This conversion bridges the gap between your digital screen (RGB) and absolute physical reality.

Universal

RGB varies by screen. CMYK varies by printer. XYZ is constant. It is "Device Independent".

The Bridge

To go from RGB to Lab or RGB to CMYK, algorithms usually pass through XYZ first.

Luminance (Y)

The 'Y' channel perfectly matches the human perception of brightness.

Why "Gamma Correction" Matters

Linear vs Non-Linear

Your monitor is non-linear. If you send it 50% voltage, it produces less than 50% light (this is called Gamma 2.2). To calculate XYZ, we first have to undo this. We "linearize" the RGB values to get the actual physical light energy. Only then can we multiply by the specific matrix to get XYZ. This tool handles all that math for you instantly.

Pro Tips for Color Science

  • Accessibility: Use the Y value directly to calculate WCAG luminance and contrast ratios.
  • ICC profiles: XYZ is the Profile Connection Space (PCS) in ICC v2 profiles; Lab in v4.
  • Color matching: For Delta E calculations, convert to Lab first (XYZ → Lab).
  • Spectral data: XYZ integrates spectral reflectance with CIE standard observer functions.

Y = Luminance (The Key Insight)

Human eyes are more sensitive to Green/Yellow light than Blue/Red.

  • Green (0, 255, 0) has a Y of ~71.5. It looks very bright.
  • Blue (0, 0, 255) has a Y of ~7.2. It looks very dark.
  • Red (255, 0, 0) has a Y of ~21.2.

Even though the computer sees them all as "255" intensity, the 'Y' value tells us the true perceived brightness.

Who Uses RGB to XYZ?

Color Scientists

Research color perception and develop new color models.

ICC Profile Engineers

Build and validate color profiles for print and display.

Display Calibrators

Calibrate monitors for accurate color reproduction.

Spectrophotometer Operators

Measure physical color samples and convert to digital values.

Frequently Asked Questions

What is the XYZ Color Space?

Created in 1931 by the CIE, it is the first mathematically defined link between wavelengths of light in the physical world and physiological perceived colors in human vision. It encompasses all colors visible to the human eye.

Why convert RGB to XYZ?

RGB is device-dependent (my screen is different from yours). XYZ is device-independent (physics). If you want to convert RGB to CMYK or Lab accurately, you usually must convert to XYZ first as a bridge.

What is 'Y' in XYZ?

The 'Y' component represents Luminance (brightness) exactly as humans perceive it. This is why Y is often used to calculate contrast ratios for accessibility.

Why are the numbers greater than 1?

Depending on the scale, XYZ values can range from 0 to roughly 100 (referencing the white point). Typically White (D65) is X=95.04, Y=100.00, Z=108.88.

How does the formula work?

First, we 'linearize' the RGB values (removing the Gamma calibration of 2.2 or 2.4). Then we multiply the linear RGB vector by a specific 3x3 matrix to project it into XYZ space.

Does XYZ represent imaginary colors?

Yes! The mathematical XYZ space is larger than the human visible spectrum to ensure mathematical simplicity. Some coordinate combinations in XYZ cannot be seen by the human eye.

What is the Reference White?

Standard RGB (sRGB) uses D65 (Daylight, 6500K) as its white point. This tool assumes D65 illuminant for all calculations.

What's the difference between sRGB and Adobe RGB matrices?

Different color spaces use different RGB primaries, requiring different transformation matrices. sRGB covers ~35% of visible colors; Adobe RGB covers ~50%. This tool uses the sRGB matrix.

What is chromaticity (xy)?

Chromaticity removes brightness, leaving only hue and saturation. Calculate it as x = X/(X+Y+Z) and y = Y/(X+Y+Z). The CIE chromaticity diagram plots all visible colors on a 2D horseshoe shape.

When would I use D50 instead of D65?

D50 (5000K) is the standard for print and prepress workflows. D65 is for screens. ICC profiles often require chromatic adaptation between D50 and D65.

How do I convert XYZ to xyY?

xyY separates chromaticity from luminance: x = X/(X+Y+Z), y = Y/(X+Y+Z), and Y stays the same. This is useful for plotting on chromaticity diagrams.

What Python libraries handle XYZ conversion?

Use 'colour-science' for professional colorimetry or 'colormath' for simpler conversions. Both handle sRGB linearization and matrix multiplication correctly.