Wavelength Color Calculator: Find Color from Wavelength
- RGB value
- Result
- Wavelength
- 550 nm
- You entered
This wavelength color calculator converts a light wavelength in nanometers (nm) into its approximate perceived color, giving you the hue name and a visual representation of that color. You enter the wavelength value, and the calculator returns the closest color name and the corresponding RGB (red-green-blue) values used to display it on screen. It is a quick tool for students, designers, and hobbyists who need to translate the physics of light into the colors we see.
Formula
The visible spectrum spans roughly 380 nm (violet) to 750 nm (deep red). To map a wavelength to an RGB color, we use a well-known approximation that divides the spectrum into segments and assigns linear RGB values based on the position within each segment. One common method (the “Cline” algorithm) works as follows:
- For wavelengths between 380 and 440 nm, red ramps up from 0 to 1, green stays 0, blue is fixed at 1.
- Between 440 and 490 nm, red is 0, green ramps from 0 to 1, blue is 1.
- Between 490 and 510 nm, red is 0, green is 1, blue ramps down from 1 to 0.
- Between 510 and 580 nm, red ramps from 0 to 1, green is 1, blue is 0.
- Between 580 and 645 nm, red is 1, green ramps down from 1 to 0, blue is 0.
- Between 645 and 780 nm, red is 1, green is 0, blue is 0.
After computing the raw RGB values, they are adjusted by a factor that decreases near the edges of the visible range (to mimic the eye’s lower sensitivity there) and then scaled to 0–255 for display. The color name is assigned by checking which range the wavelength falls into (e.g., 380–450 nm = violet, 450–495 nm = blue, 495–570 nm = green, 570–590 nm = yellow, 590–620 nm = orange, 620–750 nm = red).
Worked Example
Using the default wavelength of 550 nm:
- 550 nm is between 510 and 580 nm, so red = (550-510)/(580-510) = 40/70 ≈ 0.571, green = 1, blue = 0.
- Apply the intensity factor: for 550 nm, the factor is 1.0 (since it’s near the center of the visible range).
- Scale to 8-bit: red = 0.571 × 255 ≈ 146, green = 255, blue = 0.
- The resulting RGB is (146, 255, 0), a bright yellow-green. The color name is “green-yellow” or simply “green” depending on the naming scheme.
So for 550 nm, the calculator shows a yellow-green color with RGB (146, 255, 0).
How to Use the Calculator
Simply type the wavelength in nanometers into the input field. The calculator accepts values from 380 nm to 750 nm, which covers the entire human-visible spectrum. If you enter a value outside that range, the result will be black or undefined because the human eye cannot see those wavelengths. For a quick reference:
- 400 nm – Violet
- 470 nm – Blue
- 510 nm – Green
- 580 nm – Yellow
- 620 nm – Orange
- 700 nm – Red
The output gives you the approximate color name and the RGB triplet. The RGB value is what a computer monitor uses to display the color, so you can use it in design software or code.
Common Mistakes and Limitations
One common mistake is assuming that the RGB value is a physical property of light. In reality, RGB is a device-dependent color space; different monitors will show slightly different shades. Also, the conversion from wavelength to RGB is inherently approximate because the human eye’s response is not a simple linear function of wavelength. The Cline algorithm is a good approximation but not a physical model. Another mistake is using wavelengths outside 380–750 nm; these are invisible to humans (ultraviolet or infrared) and cannot be displayed meaningfully.
Also note that spectral colors are pure, but many colors we see (like brown or pink) are not in the spectrum; they require a mix of wavelengths. This calculator only handles pure spectral colors.
Why Convert Wavelength to Color?
This conversion is useful in many fields:
- Astronomy: identifying emission lines from nebulae or stars.
- Chemistry: flame tests and spectroscopy.
- Design: matching LED colors to a desired hue.
- Education: teaching the relationship between light and color.
For example, a sodium lamp emits at 589 nm, which appears yellow-orange. Knowing that, you can predict the color of a light source if you know its wavelength.
Alternatives and Related Concepts
If you need a more precise color representation, you might use the CIE 1931 color space, which is based on human perception. Converting wavelength to CIE XYZ and then to RGB gives more accurate results, but requires more complex formulas and a color profile. There are also online tools that show the full spectrum with a slider; this calculator is a quick reference for a single value.
For those working with LEDs, the dominant wavelength is often listed in datasheets, and this calculator helps you visualize what that wavelength looks like. For lasers, the wavelength is a key specification, and this tool can show you the color of the beam.
Frequently Asked Questions
What is the visible spectrum range?
The human eye can typically detect light from about 380 nm (violet) to 750 nm (deep red). Some people can see slightly beyond these limits, especially younger individuals, but the standard range is 380–750 nm.
Why does my monitor not show the exact color?
Monitors use RGB phosphors or LEDs that are not perfect representations of spectral colors. Also, the conversion algorithm is an approximation. The color you see depends on your monitor’s calibration and color profile. For a more accurate match, you would need a calibrated monitor and a color-managed workflow.
Can I use this calculator for wavelengths outside the visible range?
No, the calculator only works for 380–750 nm. For ultraviolet (below 380 nm) or infrared (above 750 nm), the human eye cannot see the light, so there is no meaningful color to display. The calculator will output black or an error for those values.
What is the difference between spectral color and a color like magenta?
Spectral colors are those that correspond to a single wavelength, like pure red or green. Magenta, pink, and brown are not spectral; they are perceived when multiple wavelengths are combined. This calculator only handles single wavelengths, so it cannot produce those non-spectral colors.
How accurate is the RGB conversion?
The conversion is a good approximation for educational and design purposes, but it is not physically exact. The Cline algorithm is widely used and gives reasonable results, but for scientific work, you should use a more rigorous colorimetry approach like CIE XYZ.
Related
Formula used
in nm | Wavelength | nm | 550 | 380 out color | Approximate color | - | 0 | 0 out rgb | RGB value | - | 0 | 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.