XYZ to HEX Converter

Enter CIE XYZ tristimulus values and instantly get the sRGB hex color code with a live color swatch.

CIE XYZ Input D65 normalized

0 – ~0.9505
0 – 1.0000
0 – ~1.0890

Load a preset

sRGB Output

#3B82F6
R
59
G
130
B
246
CSS rgb()
rgb(59, 130, 246)
CSS color()
color(srgb 0.2314 0.5098 0.9647)

XYZ (D65) → sRGB Inverse Matrix

X Y Z
Rlin 3.2404542 -1.5371385 -0.4985314
Glin -0.9692660 1.8760108 0.0415560
Blin 0.0556434 -0.2040259 1.0572252
Copied!

Summary

Enter CIE XYZ tristimulus values and instantly get the sRGB hex color code with a live color swatch.

How it works

  1. Enter X, Y, and Z values in the input fields (valid range roughly 0–1 for D65-normalized sRGB).
  2. The tool multiplies the XYZ values by the inverse D65 sRGB matrix to obtain linear RGB.
  3. Each linear channel is gamma-encoded using the IEC 61966-2-1 sRGB transfer function.
  4. Linear values are clamped to 0–1 before encoding to stay within the sRGB gamut.
  5. The resulting R, G, B values (0–255) are formatted as a 6-digit uppercase hex code.
  6. A live color swatch and one-click copy button update instantly as you type.

Use cases

Frequently Asked Questions

Related tools

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