XYZ to RGB Converter

Enter CIE XYZ tristimulus values and instantly get the equivalent sRGB (0–255) color with a live preview swatch.

CIE XYZ Input

0.4124
0.2126
0.0193
#FF0000

RGB Output

Conversion Steps

  1. 1 XYZ input: X=0.4124, Y=0.2126, Z=0.0193
  2. 2 XYZ → Linear RGB (D65 matrix): Rl=1.0000, Gl=0.0000, Bl=0.0000
  3. 3 Linear RGB → sRGB (gamma encode): R=1.000, G=0.000, B=0.000
  4. 4 Scale & clamp to 0–255: R=255, G=0, B=0 (#FF0000)
Copied!

Summary

Enter CIE XYZ tristimulus values and instantly get the equivalent sRGB (0–255) color with a live preview swatch.

How it works

  1. Enter X, Y, and Z values using the number inputs or sliders (typical range 0–1 for normalized XYZ, or 0–100 for percentage scale).
  2. XYZ values are multiplied by the inverse sRGB D65 matrix to produce linear RGB channel values.
  3. Linear RGB is gamma-encoded with the sRGB transfer function (IEC 61966-2-1) to produce non-linear sRGB in the 0–1 range.
  4. Values are scaled to 0–255 and clamped to the nearest displayable integer.
  5. The HEX code and rgb() CSS string are derived from the clamped integers.
  6. A live color swatch previews the result; out-of-gamut inputs are clamped to the nearest displayable color.

Use cases

Frequently Asked Questions

Related tools

Last updated: 2026-05-28 · Reviewed by Nham Vu