Wavelength to Colour Converter
Convert a light wavelength in nanometres to approximate sRGB and hex using Bruton's ramp, alongside exact photon energy in eV and frequency in terahertz.
Wavelength
Approximate colour
Visible spectrum
Notable spectral lines
CSS
:root {
--wavelength-532nm: #65ff00;
}
.spectrum-bar {
background-image: linear-gradient(90deg, #610061 0.0%, #8100a5 4.0%, #7b00e2 8.0%, #4600ff 12.0%, #0022ff 16.0%, #007bff 20.0%, #00c4ff 24.0%, #00ffea 28.0%, #00ff28 32.0%, #46ff00 36.0%, #81ff00 40.0%, #b6ff00 44.0%, #e7ff00 48.0%, #ffe600 52.0%, #ffb000 56.0%, #ff7700 60.0%, #ff3400 64.0%, #ff0000 68.0%, #ff0000 72.0%, #ff0000 76.0%, #ff0000 80.0%, #e20000 84.0%, #c40000 88.0%, #a50000 92.0%, #840000 96.0%, #610000 100.0%);
}The colours come from Dan Bruton's widely reproduced piecewise approximation, valid for 380–780 nm. It is a visual approximation for illustration, not a colorimetric conversion — a rigorous answer would integrate the CIE 1931 colour-matching functions and then map the result into sRGB, and most spectral colours fall outside the sRGB gamut entirely, so no screen can display them accurately. The photon energy and frequency figures, by contrast, are exact: E = hc/λ and f = c/λ with the SI 2019 constants.
What is the Wavelength to Colour Converter?
Visible light runs from about 380 nanometres at the violet end to 780 at the deep red end. This converter maps a wavelength in that range to an approximate screen colour, and gives you the physics alongside it: photon energy in electronvolts, frequency in terahertz and the wavenumber.
- Bruton's approximation across the full 380 to 780 nm range
- Exact photon energy in eV and joules, plus frequency in THz
- Full visible spectrum strip rendered from the same model
- Eight notable spectral lines including sodium D and helium-neon
- Nearest CSS named colour and the spectral band name
- Copyable CSS variable and a ready-made spectrum gradient
How to use the Wavelength to Colour Converter
- 1
Drag the wavelength slider or type an exact value in nanometres.
- 2
Use the quick jump buttons to move between 400 and 700 nm in steps.
- 3
Read the hex, rgb(), hsl(), photon energy, frequency and wavenumber.
- 4
Click any of the notable spectral lines to jump straight to it.
- 5
Copy the CSS custom property or the full spectrum gradient.
About the Wavelength to Colour Converter
Visible light runs from about 380 nanometres at the violet end to 780 at the deep red end. This converter maps a wavelength in that range to an approximate screen colour, and gives you the physics alongside it: photon energy in electronvolts, frequency in terahertz and the wavenumber.
The colours come from Dan Bruton's widely reproduced approximation — a piecewise linear ramp across six bands, an intensity falloff at both ends of the visible range where the eye loses sensitivity, and a 0.8 gamma encode. At 400 nm it produces rgb(131, 0, 181); at 532 nm, the green laser pointer wavelength, a vivid green.
The energy and frequency figures are exact, using the SI 2019 values for Planck's constant and the speed of light. The colours are honestly approximate, and the note at the bottom of the page explains why no screen can show a true spectral colour. Everything runs in your browser with nothing uploaded.
Frequently asked questions
What colour is 532 nm?
532 nanometres is the bright green of a standard green laser pointer, produced by frequency-doubling a 1064 nm infrared laser. On screen it renders as a vivid pure green, though the real thing is far more saturated than any monitor can reproduce.
How accurate is wavelength to RGB conversion?
It is an illustration rather than a measurement. A rigorous conversion integrates the CIE 1931 colour matching functions and then maps into sRGB, and the honest answer is that most spectral colours fall well outside the sRGB gamut, so no screen can display them accurately. Bruton's ramp gives a recognisable impression of each wavelength.
How do you calculate photon energy from wavelength?
Use E = hc divided by lambda, where h is Planck's constant and c is the speed of light. Divide by the elementary charge to express the result in electronvolts. At 550 nm that gives about 2.25 eV, and the tool shows the figure in both eV and joules.
What is the visible light spectrum range?
Roughly 380 to 780 nanometres, though sensitivity falls off sharply at both ends and individuals vary. Below 380 is ultraviolet and above 780 is infrared, neither of which the eye registers. That is why the colours here fade towards black at the edges of the range.
Why does violet look purple on screen?
Because true violet is a single short wavelength that sRGB cannot reach, so the approximation substitutes a mix of blue and red. Purple is not a spectral colour at all — it only exists as a combination — but it is the closest a screen can get to the violet end of the spectrum.
Related tools
Colour Temperature to RGB Converter
Convert a colour temperature in kelvin to sRGB and hex using the Tanner Helland blackbody fit, with reference points from candlelight to clear polar sky.
CSS Color Format Converter
Turn one colour into every modern CSS syntax at once: hex, rgb, hsl, hwb, lab, lch, oklab, oklch and display-p3, each with its own copy button.
HEX to RGB Converter
Convert HEX color codes to RGB and RGBA instantly. Supports 3, 6 and 8-digit HEX with a live color swatch, batch list conversion and one-click copy.
Color Picker
Pick any color and get its HEX, RGB and HSL values instantly. Free online color picker with shades, tints and one-click copy for designers and developers.
RGB to HSL Converter
Convert RGB values to HSL instantly. Enter red, green and blue channels and get hue, saturation and lightness with a live swatch and copyable hsl() output.