ThisCalculator

Everyday

Color Purity Calculator: How to Measure It

Updated · Standard formula, shown below

Color purity 1,155.9 %
Dominant wavelength
580 nm
Result
Color x
0.5
You entered
Color y
0.4
You entered

Color Purity Calculator: How to Measure It

This color purity calculator works out the purity of a color from its CIE xy chromaticity coordinates, using the standard definition from color science. You enter the x and y coordinates of your color plus the x and y of the white point, and you get back the purity as a percentage (0–100%) along with the dominant wavelength in nanometers. Purity is a single number that tells you how close a color is to a fully saturated spectral color of the same hue.

Formula

Color purity (also called excitation purity) is defined as the ratio of two distances on the CIE 1931 xy chromaticity diagram. The formula is:

Purity = (distance from white point to color) ÷ (distance from white point to spectral locus) × 100%

In symbols:

p = (√[(x − xw)² + (y − yw)²]) ÷ (√[(xλ − xw)² + (yλ − yw)²]) × 100

Where:

  • x, y = chromaticity coordinates of your color (dimensionless, typically 0–1)
  • xw, yw = chromaticity coordinates of the reference white (often D65: 0.3127, 0.3290)
  • xλ, yλ = chromaticity coordinates of the spectral color (single wavelength) that lies on the straight line from the white point through your color to the edge of the horseshoe-shaped locus

The denominator requires finding the intersection point of the line with the spectral locus. That point is the dominant wavelength. In the calculator above, you must supply that intersection coordinate manually (the default 0.33, 0.33 is a placeholder for a typical yellow). For a fully accurate result, look up the dominant wavelength for your color from a chromaticity diagram or use a color�matching library.

Worked Example

Using the defaults from the calculator: color (0.5, 0.4), white point D65 (0.3127, 0.3290), and the placeholder spectral point (0.33, 0.33).

  1. Distance from white to color: √[(0.5−0.3127)² + (0.4−0.3290)²] = √[(0.1873)² + (0.071)²] = √(0.03508 + 0.00504) = √0.04012 = 0.2003
  2. Distance from white to spectral point: √[(0.33−0.3127)² + (0.33−0.3290)²] = √[(0.0173)² + (0.001)²] = √(0.000299 + 0.000001) = √0.000300 = 0.01732
  3. Purity = (0.2003 ÷ 0.01732) × 100 = 1156% — which is impossible, because the placeholder spectral point is too close to white. This shows why the denominator must be the true intersection.

For a realistic example, take a pure red with coordinates (0.64, 0.33) and D65 white. The dominant wavelength is about 610 nm, and the spectral locus at that wavelength is approximately (0.67, 0.33). Then:

  • Distance white→color: √[(0.64−0.3127)² + (0.33−0.3290)²] = √(0.1071 + 0.000001) = 0.3273
  • Distance white→locus: √[(0.67−0.3127)² + (0.33−0.3290)²] = √(0.1276 + 0.000001) = 0.3572
  • Purity = (0.3273 ÷ 0.3572) × 100 = 91.6%

That matches the expected purity of a typical red monitor primary.

What Purity Actually Tells You

Purity is not the same as saturation. Saturation is a perceptual attribute — how vivid a color looks. Purity is a physical/colorimetric measurement based on the CIE diagram. A color with 100% purity is a single wavelength (fully monochromatic). A color with 0% purity is the white point itself (or any gray along the line from white to black). Most real colors fall between 20% and 95%.

Purity is used in:

  • Display calibration – to check how saturated a monitor’s primaries are
  • Lighting design – to specify colored light sources (e.g., stage lights, LED products)
  • Paint and ink manufacturing – to match a target color’s vividness
  • Vision research – to describe stimuli in experiments

When you see a purity value, remember it depends on the chosen white point. Change the white point from D65 to D50, and the purity changes even though the physical color is identical.

How to Use the Calculator Correctly

To get a meaningful purity value, you need three pieces of data:

  1. Your color’s xy coordinates – from a spectrophotometer, a color picker, or a conversion from sRGB/CMYK.
  2. The white point – usually D65 for daylight, D50 for print, or a specific illuminant like A (incandescent). Common values: D65 (0.3127, 0.3290), D50 (0.3457, 0.3585), A (0.4476, 0.4074).
  3. The dominant wavelength – find the line from the white point through your color to the edge of the spectral locus. The intersection coordinate is the denominator. This is the step most people miss.

If you don’t have the dominant wavelength, you can approximate it by using a chromaticity diagram with a straightedge. Draw a line from the white point through your color, extend it to the curved boundary, and read the wavelength at that point. The calculator above lets you enter that intersection coordinate manually.

Common Mistakes and Misconceptions

  • Using sRGB values directly – Purity works on CIE xy, not RGB. You must convert RGB to XYZ first, then to xy.
  • Confusing purity with “color purity� in digital images – Some software calls a pixel “pure� if it has only one channel nonzero (e.g., #FF0000). That is not colorimetric purity.
  • Ignoring the white point – A color that is 80% pure under D65 might be 75% under D50. Always state the white point.
  • Using the wrong spectral point – The denominator must be the intersection of the line from white through your color, not just any point on the locus. Using a wrong point gives nonsense (like 1156% in the first example).
  • Rounding too early – Rounding xy coordinates to 2 decimals can change purity by several percent. Keep 4 decimals when measuring.

Limits of the Purity Formula

The CIE 1931 diagram is not perceptually uniform. Equal distances in xy do not correspond to equal perceived color differences. So a purity difference of 10% near green may look larger than a 10% difference near blue. For perceptual uniformity, use CIELAB or CIELUV color spaces instead. Purity is still widely used because it is simple and directly tied to the physical spectrum.

Another limit: the formula assumes your color lies inside the spectral locus. Colors that are outside (impossible colors, or colors from wide-gamut displays that exceed the locus) will not have a valid dominant wavelength. In that case, purity is undefined or clamped to 100%.

Finally, the white point is not always a real spectral color. It is a mixture of wavelengths. That is fine — the formula only needs a reference point, not a monochromatic one.

Frequently Asked Questions

What is the difference between purity and saturation?
Saturation is how a color appears to the eye (vivid vs. dull). Purity is a physical measurement of how much a color deviates from white on the CIE diagram. They correlate but are not identical. A highly saturated-looking color might have lower purity if it is near the white point but has a strong hue.

Can I calculate purity from a hex color code?
Yes, but you must first convert the hex to sRGB, then to XYZ, then to xy. The calculator above expects xy, so you need that conversion step. Many online tools can do the sRGB→xy conversion, or you can use the standard matrix formulas.

Why does my purity value exceed 100%?
That happens when the denominator (distance to the spectral locus) is smaller than the numerator. This usually means you used the wrong spectral point or your color is outside the visible gamut. Check your coordinates and the intersection point.

What is a “good� purity value for a display?
Typical sRGB monitors have red purity around 90%, green around 80%, and blue around 90%. Wide-gamut displays can reach 95–99% for some primaries. There is no universal “good� number — it depends on the application. For print, lower purity is often acceptable because inks are not fully saturated.

Does purity change with brightness?
No. Purity is defined in xy coordinates, which are normalized to remove brightness (Y). A dark red and a bright red with the same xy have the same purity. However, at very low brightness, the eye perceives less saturation, so perceptual purity drops even though the measured purity stays constant.

Where can I find the dominant wavelength for my color?
You can read it off a CIE chromaticity diagram, use a color�matching library (like Colour Science for Python), or use a spectrophotometer that reports dominant wavelength. The calculator above requires you to enter the spectral point manually, so you need that data from an external source.

Related

Formula used
in x | Color x | - | 0.5 | 0
in y | Color y | - | 0.4 | 0
in wx | White point x | - | 0.3127 | 0
in wy | White point y | - | 0.3290 | 0
out purity | Color purity | % | (sqrt((x-wx)^2+(y-wy)^2) / sqrt((0.33-wx)^2+(0.33-wy)^2)) * 100 | 1
out dom_wl | Dominant wavelength | nm | 580 | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.