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)
Input is outside the sRGB gamut — channels have been clamped to the nearest displayable color.
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
- Enter X, Y, and Z values in the input fields (valid range roughly 0–1 for D65-normalized sRGB).
- The tool multiplies the XYZ values by the inverse D65 sRGB matrix to obtain linear RGB.
- Each linear channel is gamma-encoded using the IEC 61966-2-1 sRGB transfer function.
- Linear values are clamped to 0–1 before encoding to stay within the sRGB gamut.
- The resulting R, G, B values (0–255) are formatted as a 6-digit uppercase hex code.
- A live color swatch and one-click copy button update instantly as you type.
Use cases
- Convert CIE XYZ color measurements from a spectrophotometer to a displayable hex code.
- Reverse-check XYZ values produced by an RGB-to-XYZ pipeline.
- Map Lab/LCH colors back to sRGB hex by first converting to XYZ.
- Verify ICC profile color transforms by testing known XYZ primaries.
- Build color management tools that work in XYZ space and need sRGB output.
- Explore how out-of-gamut XYZ values clip when converted to sRGB.
- Cross-check color conversions between design and print workflows.
- Learn CIE color science by seeing how tristimulus values map to familiar hex codes.
Frequently Asked Questions
Related tools
Last updated: 2026-05-28 ·
Reviewed by Nham Vu