Tool · Units and conversions

Wavelength to Color Converter

What color is light of a given wavelength, and how bright does it look? The converter takes a vacuum wavelength and returns the color name, the nearest sRGB screen color as a hex code, the CIE 1931 chromaticity, the eye’s daylight and night sensitivity, and the photon energy, using the CIE tables at 1 nm. Background: visible light, radiometry and photometry and photon energy.

Wavelength
Visible light runs from about 380 to 780 nm; the CIE tables used here stop there. No screen can show a spectral color exactly: every one lies outside the sRGB gamut, so the swatch is the nearest color the screen can make.
Presets
Readouts
The visible spectrum and the eye’s response
The strip is each wavelength mapped to sRGB by clipping. The blue line is the daylight (photopic) response V(λ), the dashed orange line the night (scotopic) response V′(λ).
CIE 1931 chromaticity diagram
The horseshoe is the spectral locus, every monochromatic color; the triangle is what an sRGB screen can show, with the D65 white point inside. A spectral color can only be approached from inside the triangle.
Learn with it

Two short experiments. Each one sets the inputs, says where to look, and asks for a prediction before it shows the result.

Checked against

These checks run in your browser on every load. The tables, the chromaticity, the sRGB conversion and the photon energy are compared with the CIE values and with values worked out by hand.

CheckExpectedComputedTolerance

The expected values are CIE 1931 and CIE 1951 table entries at whole nanometers, chromaticities from them, the IEC 61966-2-1 sRGB encoding, and E = hc/λ with the exact SI constants. The tolerance is the largest difference from Expected that still passes, relative to Expected or to 1, whichever is larger.

The model

A monochromatic light of unit power at wavelength λ has CIE 1931 tristimulus values equal to the color-matching functions at that wavelength,

X=xˉ(λ),Y=yˉ(λ),Z=zˉ(λ),x=XX+Y+Z,y=YX+Y+Z

and yˉ(λ) is the photopic luminous efficiency V(λ). The screen color comes from the sRGB matrix of IEC 61966-2-1,

(RGB)=(3.2406−1.5372−0.4986−0.96891.87580.04150.0557−0.20401.0570)(XYZ)

followed by the sRGB gamma encoding. Every spectral color lies on the horseshoe of the chromaticity diagram, outside the sRGB triangle, so at least one channel comes out negative. Clipping sets it to zero, which moves the color to the triangle’s edge and slightly changes its hue; adding white raises all three channels equally until none is negative, which keeps the line from the D65 white point to the spectral color (its dominant wavelength) at the cost of saturation. The largest channel is then scaled to 1, so the swatch shows the hue at full brightness; the efficiency V(λ) and the luminous efficacy 683 V(λ) lm/W say how bright one watt of it actually looks. The tables are those of the CIE 1931 2° observer and the CIE 1951 scotopic observer from 380 to 780 nm, linearly interpolated between whole nanometers; the color names follow common band edges, which vary by a few nanometers between sources.

Worked example

At 532 nm the tables give xˉ=0.1891, yˉ=0.8850, zˉ=0.03694, chromaticity (0.1702,0.7965). The red channel is negative; clipping gives #00ff00, the full green of the screen. One watt at 532 nm is 604.4 lumens in daylight, and the photon energy is 2.3305 eV. At 450 nm V=0.038, so a blue laser of the same power looks about 23 times dimmer.

Related: the lumens to watts converter uses the same CIE tables, the wavelength calculator converts between wavelength, frequency and energy, and the electromagnetic spectrum entry places the visible band among the others.

References: ISO/CIE 11664-1:2019, Colorimetry, part 1: CIE standard colorimetric observers. CIE 015:2018, Colorimetry, 4th ed. IEC 61966-2-1:1999, Multimedia systems and equipment: colour measurement and management, part 2-1: default RGB colour space, sRGB. G. Wyszecki and W. S. Stiles, Color Science, 2nd ed., Wiley (1982).