RGB to XYZ Converter

Enter R, G, B values (0–255) and instantly get CIE XYZ tristimulus values with a live color preview and one-click copy.

sRGB Input

or enter values below
#3B82F6 rgb(59, 130, 246)

CIE XYZ Output D65 illuminant · IEC 61966-2-1

X
0.0000
Y
0.0000
Z
0.0000
XYZ Tuple
xyz(0.0000, 0.0000, 0.0000)
CSS color()
color(xyz 0.0000 0.0000 0.0000)
Relative Luminance (Y) 0.00%

Y=0 is black, Y=1 is D65 white. Used for WCAG contrast ratio calculations.

sRGB → XYZ (D65) Matrix

Rlin Glin Blin
X 0.4124 0.3576 0.1805
Y 0.2126 0.7152 0.0722
Z 0.0193 0.1192 0.9505
Copied!

Summary

Enter R, G, B values (0–255) and instantly get CIE XYZ tristimulus values with a live color preview and one-click copy.

How it works

  1. Enter R, G, and B values (each between 0 and 255) in the input fields or use the color picker.
  2. Each channel is linearized by removing the sRGB gamma curve (IEC 61966-2-1).
  3. The linearized RGB values are multiplied by the standard D65 sRGB-to-XYZ matrix.
  4. The resulting X, Y, and Z tristimulus values are shown, normalized so Y=1 for white.
  5. Click any "Copy" button to copy individual values, or "Copy All" for the full XYZ tuple.
  6. A live color swatch confirms the input color at a glance.

Use cases

  • Convert sRGB colors to XYZ for ICC profile and color management workflows.
  • Feed XYZ values into Lab, LCH, or other perceptual color models.
  • Verify color transformation math in image-processing pipelines.
  • Understand the device-independent representation of screen colors.
  • Compute luminance (Y channel) for contrast ratio and WCAG accessibility checks.
  • Build spectral or gamut-mapping tools that operate in XYZ space.
  • Cross-check color output between design and print workflows.
  • Learn CIE color science by exploring how RGB maps to tristimulus values.

Frequently Asked Questions

Last updated: 2026-06-10 · Reviewed by Nham Vu