Wavelength to color
Enter a wavelength of light in nanometres and get the nearest color a screen can show, in HEX and RGB. The calculation uses the CIE 1931 standard observer, the same data color science is built on.
Wavelength
Most vivid on screen
Channels the screen cannot show are cut to zero. The hue may shift a little.
Same dominant wavelength
White light added until the screen can show it (14% of the mix). Keeps the CIE hue line, loses saturation.
- Band: yellow
- Brightness to the eye: 87.0% of 555 nm
- CIE xy: 0.5125, 0.4866
How the color is calculated
The CIE 1931 color-matching functions say how strongly the average eye responds to each wavelength, in three values X, Y and Z. Those are converted to linear sRGB with the standard matrix and given the sRGB gamma. A single wavelength always lands outside the sRGB triangle, so one or two of the three channels come out negative; the two swatches are two honest ways of bringing it back in, and the page says which one is which.
The table is the CIE dataset at 1 nm steps, rounded here to six significant figures; between whole nanometres the values are interpolated in a straight line. Both swatches are scaled so the brightest channel is full, which is why deep violet and deep red look far brighter here than the eye sees them in real light.
Wavelength to color: questions
- What color is a given wavelength?
- Type the wavelength in nanometres. The page looks up the CIE 1931 color-matching functions at that wavelength, turns them into the sRGB color space screens use, and shows the result in HEX and RGB. Roughly: below 450 nm violet, 450–485 blue, 485–500 cyan, 500–565 green, 565–590 yellow, 590–625 orange, above 625 red. The borders between names are a convention, not physics.
- Why are there two colors for one wavelength?
- Light of a single wavelength is more saturated than anything a screen can make, so there is no exact screen color for it. The left swatch cuts the channels the screen cannot show to zero: it is the most vivid, but its hue can shift. The right swatch mixes in white light until the color fits: it keeps the same dominant wavelength on the CIE chart but looks paler. Pick the one that suits your use.
- Why do other wavelength to RGB tools give different values?
- Many of them use a hand-made piecewise formula that draws straight lines between a few chosen colors. This page computes from the CIE 1931 standard observer table at every nanometre instead. Both are approximations of a color a screen cannot show, so neither is “the” RGB of a wavelength; the numbers here can be traced to the published CIE data.
- What does “brightness to the eye” mean?
- It is the CIE luminous efficiency ȳ(λ): how bright light of that wavelength looks compared with the same power at 555 nm, where the eye is most sensitive in daylight. Near 400 or 700 nm it is below 1%, so a laser of those colors looks dim. The swatches are scaled to full brightness and do not show this.
- Can I enter ultraviolet or infrared?
- The table runs from 360 to 830 nm, where the human eye still responds very weakly. Outside it the eye responds too little to give a color, so the page stops there.
Sources
- International Commission on Illumination (CIE) (2019). Colour-matching functions of CIE 1931 standard colorimetric observer (dataset), 360–830 nm in 1 nm steps, from CIE 018:2019. Licence CC BY-SA 4.0. DOI