We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
A two-way converter for RGB and XYZ color codes, ideal for web design and image processing.
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
This converter maps 8-bit sRGB values or a HEX color to CIE XYZ, and converts XYZ values back to an sRGB preview. RGB channels range from 0 to 255; the HEX form is #RRGGBB. XYZ values are tristimulus coordinates: X, Y, and Z work together to represent a color, and they are not simply renamed red, green, and blue channels. In the relative scale used here, Y=100 represents reference white; Y is proportional to luminance under the CIE definition.
The conversion assumes standard sRGB primaries and the D65 reference white. sRGB channel values are nonlinear, so the forward calculation first linearizes each channel, then applies the sRGB-to-XYZ matrix. The W3C CSS Color specification documents that sequence and colorimetric assumptions. RGB-to-XYZ results display up to four decimal places. The reverse direction applies the inverse matrix, encodes sRGB, rounds channels to integers, and clips each channel to 0–255.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Set integer R, G, and B channel values or enter a six-digit HEX color such as #4D8DEA. The color preview and XYZ values update together.
Copy HEX, the RGB triplet, all XYZ values, or an individual XYZ component. The combined copy option returns the available representations as text.
Change X, Y, or Z to update the reverse conversion, preview, and RGB/HEX values. Each XYZ slider covers 0–100 in 0.01 increments; values outside the sRGB displayable gamut cannot be represented exactly by the returned RGB.
For a check value, #4D8DEA is RGB (77, 141, 234). Applying the specified sRGB D65 transform gives approximately X=27.4314, Y=26.5653, Z=81.5079. Black maps to (0, 0, 0); white maps approximately to (95.047, 100, 108.883). Small differences in the last displayed digits can come from rounding.
Use cases
See how the tool fits into real work and everyday tasks.
A developer can compare an interface HEX color with XYZ values when reviewing a calculation or passing coordinates into a compatible workflow.
A designer can copy RGB, HEX, and XYZ together so a color specification carries both its familiar screen value and the assumed colorimetric coordinates.
Q&A
Find concise answers to common questions and confusing cases.
RGB values do not define a unique XYZ result without a color space and white point. This tool interprets RGB as sRGB with D65; workflows using a different profile or white point can produce different coordinates.
XYZ-to-RGB rounds channels to whole numbers and clips them to the 0–255 range. If the requested XYZ color lies outside the sRGB gamut, the preview cannot represent it exactly.
No. Y is one XYZ tristimulus value and is proportional to luminance; it is not the green channel or a direct screen-brightness reading. The tool uses relative values scaled so reference white has Y=100.
Notes
Review scope, result limitations, and important precautions before use.
This is a mathematical sRGB-to-XYZ conversion and preview, not full device-managed color matching. It does not account for a monitor profile, printer profile, ambient viewing conditions, or a different RGB color space. Confirm the intended white point, profile, and gamut behavior before using coordinates for print production, calibration, or a measurement workflow.
Related
Discover related tools, collections, and available API capabilities.