XYZ to RGB Converter

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

Source Input XYZ

0
0
0
Converted Result
White TextAAA (Excellent)
rgb(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;

Back to Reality: XYZ to RGB

You have a scientific color measurement (XYZ). Perhaps from a spectrometer or a theoretical calculation. To show this color to a user on a web page, you must scale it down to fit inside the sRGB limitations of a standard monitor.

This conversion is tricky because XYZ is huge and RGB is small. Our tool handles the Gamma Correction and Matrix Transformation required to render scientific data accurately.

Scientific Input

CIE 1931 XYZ coordinates. An absolute representation of physical light perception.

The Gamut

Imagine a large map (XYZ). sRGB is a small triangle on that map. We verify if your point fits inside.

Digital Output

Standard 0-255 RGB values, ready for CSS styling (`rgb(r, g, b)`).

The "Out of Gamut" Problem

Physics Limit Reached

The human eye can see extremely saturated Cyans and Greens that standard monitors literally cannot produce. If your XYZ coordinates describe one of these "super-colors", the RGB conversion will fail (producing negative numbers or numbers above 255). We "clamp" these values to the nearest displayable color, but be aware: what you see on screen may be duller than the true XYZ value.

Pro Tips for Gamut Mapping

  • Detect clipping: Check if any RGB channel exceeds 0-255 before gamma encoding.
  • Perceptual mapping: For smoother results, use Lab space for gamut compression.
  • Wide gamut displays: Target Display P3 or Rec. 2020 for modern devices.
  • Spectral rendering: For accurate simulation, work in spectral domain, not XYZ.

Reference White (The Sun)

Value (0-100 scale)Meaning
X = 95.04D65 Reference White - standardized "Daylight".
Y = 100.00Maximum Luminance (Pure White).
Z = 108.88Reference Blue component for D65.

Who Uses XYZ to RGB?

Scientific Visualization Devs

Render spectral data to displayable colors.

Medical Imaging Engineers

Convert calibrated colors for diagnostic displays.

Display Manufacturer QA

Validate color accuracy against CIE standards.

Color Science Researchers

Visualize theoretical color calculations.

Frequently Asked Questions

Can all XYZ colors be displayed in RGB?

No. The XYZ space contains all visible colors (and more). The sRGB gamut is a small triangle inside that space. If your XYZ value is outside the triangle (Out of Gamut), it will be 'clipped' to the nearest displayable color.

Does this assume sRGB?

Yes. This tool converts to the standard sRGB profile used by the web (IEC 61966-2-1). Other profiles like AdobeRGB or ProPhotoRGB use different matrices.

What happens if values are negative?

Sometimes the mathematical conversion results in negative RGB values (meaning the color is out of gamut). We clamp these values to 0 for display purposes.

Why is the image darker than expected?

XYZ is linear light. Screens are non-linear (Gamma). We apply a Gamma correction of roughly 2.2 to brighten the signal so it looks correct to the human eye on a monitor.

What is D65?

D65 is the standard illuminant representing 'Average Daylight' (approx 6500 Kelvin). sRGB is calibrated to D65. If your XYZ data was measured under Tungsten (D50), you would need a Chromatic Adaptation step first.

Is Y really just Luminance?

Yes. In the CIE system, Y was deliberately designed to match the V(λ) luminosity function of the eye. A Y of 50 means the color appears 50% as bright as the reference white.

How do I convert to wider gamuts like Display P3?

Use a different transformation matrix. Display P3 uses the same D65 white point but different RGB primaries, giving ~25% more color coverage than sRGB.

What is Bradford chromatic adaptation?

Bradford is an algorithm to convert XYZ values measured under one illuminant (like D50) to another (like D65). It simulates how human vision adapts to changing light sources.

What's the difference between relative and absolute colorimetric?

Relative colorimetric maps the source white to destination white. Absolute colorimetric preserves exact XYZ values, which may result in a color cast if white points differ.

What is gamut compression?

Instead of clipping out-of-gamut colors, compression shrinks the entire gamut to fit. This preserves color relationships but reduces overall saturation.

Does this work for HDR content?

sRGB is SDR (Standard Dynamic Range). For HDR, you'd convert to Rec. 2100 PQ or HLG using different transfer functions and wider primaries.

What is the inverse matrix for sRGB to XYZ?

The XYZ→RGB matrix is the inverse of RGB→XYZ. For sRGB/D65: [[3.2406, -1.5372, -0.4986], [-0.9689, 1.8758, 0.0415], [0.0557, -0.2040, 1.0570]].