DevTools Logo

Color Wavelength Converter

Color Wavelength Converter

Slide through 380–780 nm to see the approximate color, frequency and photon energy.

Runs in your browser

Spectrum controls

green · 555 nm
555 nmgreen
400450500550600650700750

Transition bands near 420, 440, 490, 510, 580, 645 and 700 nm are where the piecewise approximation changes segment.

0/4 saved

Color & physics

#B3FF00
Hex
#B3FF00
Band
green
RGB
rgb(179, 255, 0)
HSL
hsl(78, 100%, 50%)
Frequency
540.167 THz
Photon energy
2.234 eV
Energy in joules
3.5792e-19 J

Formulas

f = c / λ = 540.167 THz

E = hc / λ = 2.234 eV = 3.579e-19 J

c = 299 792 458 m/s · hc = 1239.841984 eV·nm. The color is the standard piecewise sRGB approximation for a standard observer, not a calibrated display profile.

Examples

Sodium D-line

Input
589 nm
Output
#FFE200 · yellow · 508.985 THz · 2.105 eV

The approximation yields warm yellow with the green channel slightly below full; the eV value matches the textbook sodium line energy.

Green laser

Input
532 nm
Output
Bright green swatch near the peak of the piecewise curve, about 563.7 THz

Most green laser pointers sit near the middle of the green segment, where the rendered color is most vivid.

Infrared input

Input
900 nm
Output
Clamped to 780 nm with an outside-visible-spectrum note; physics still reported for 900 nm

The tool separates 'no display color' from 'no physics answer' rather than painting a fake infrared swatch.

About this tool

Color Wavelength Converter answers a common physics question — what color is 589 nm? — with a live swatch and the numbers behind it. A slider from 380 to 780 nm drives the standard piecewise wavelength-to-sRGB approximation: trapezoid segments for violet through red, edge attenuation where human sensitivity falls off, and a 0.8 gamma correction. The resulting hex, rgb() and hsl() values are displayed alongside a named band such as yellow or cyan.

The tool pairs the visual answer with exact arithmetic. Frequency uses f = c/λ with c = 299 792 458 m/s, reported in terahertz to three decimals. Photon energy uses E = hc/λ with hc = 1239.841984 eV·nm, shown in electronvolts and joules. The constants and formulas are printed under the readouts, so the page works as a homework reference as well as a color lookup.

Values below 380 nm or above 780 nm are clamped with an explicit note: ultraviolet and infrared do not have display colors. Up to four markers can be saved for side-by-side comparison, with the nearest spacing reported in nanometers. Everything runs locally in the browser and no wavelength history is uploaded.

What this tool does not do

  • The color mapping is an approximation for a standard observer, not a CIE spectral calculation with a chosen illuminant.
  • Output assumes sRGB; display calibration and wide-gamut panels change the appearance.
  • Values outside the visible range are clamped for display; the physics fields still use the entered wavelength.
  • The spectrum strip is sampled at 5 nm increments, so it is a legend rather than a measurement.
  • Saved markers are session-only and capped at four; there is no URL share or persistent history.

How to use this tool

  1. Drag the slider

    Move the 380–780 nm slider to see the swatch, band name and physics values update instantly.

  2. Type a wavelength

    Enter a number in the nm field, append 'nm', or use the µm field for micrometres such as 0.589.

  3. Read the values

    Check hex, rgb(), hsl(), frequency in THz and photon energy in eV/J. The formulas and constants are listed below the readouts.

  4. Compare wavelengths

    Save up to four markers and read the nearest spacing between them; click a marker chip to restore it.

  5. Copy a value

    Use the copy buttons for hex, frequency or energy, or copy the full readout string with the keyboard shortcut.

Use cases

Physics homework

Look up the color, frequency and photon energy for a lab report in one place.

LED selection

Compare the perceived hue of dominant wavelengths before choosing a part.

Plot styling

Copy a hex approximation of a spectral line for charts and figures.

Optics demonstrations

Show the visible spectrum strip and markers while explaining band boundaries.

Spectral bands

BandWavelength range
Violet380–449 nm
Blue450–494 nm
Cyan495–509 nm
Green510–569 nm
Yellow570–589 nm
Orange590–639 nm
Red640–780 nm

Boundaries are fixed labels for readability; the underlying color is computed per nanometer, not snapped to a band.

Common mistakes

Mistake:Treating the generated hex as a measured spectral color.

Fix:It is a standard piecewise approximation for a standard observer on an sRGB display, not a spectrophotometer result.

Mistake:Expecting UV or IR swatches.

Fix:Values outside 380–780 nm are clamped and flagged; those wavelengths have no perceptual display color.

Mistake:Confusing frequency in THz with wavelength in nm.

Fix:The readout labels each unit explicitly and shows f = c/λ so the relationship is visible.

Mistake:Assuming monitors agree.

Fix:Wide-gamut and uncalibrated displays render sRGB values differently; the physics numbers remain identical.

Mistake:Typing 0.589 without a unit in the nm field.

Fix:Use the µm field or append 'µm'/'um' — a bare 0.589 is interpreted as nanometers and clamped.

Frequently asked questions

What color is 589 nm?

Approximately warm yellow — the tool renders it as #FFE200 with the band label 'yellow'. That wavelength corresponds to the sodium D-line, and the physics readouts give about 509 THz and 2.105 eV per photon.

How accurate is the wavelength-to-RGB mapping?

It is the familiar piecewise approximation: linear trapezoid segments, attenuation near 380 and 780 nm and a 0.8 gamma. It is useful for visualization and teaching, but it is not a CIE color-matching computation, and a real monochromatic light source looks different from any sRGB triplet.

Can infrared or ultraviolet be displayed?

No. Those wavelengths are outside human vision, so the tool clamps the swatch to 780 nm or 380 nm and shows an explicit note. The frequency and photon-energy readouts still describe the wavelength you typed.

How is photon energy calculated?

E = hc/λ. Using hc = 1239.841984 eV·nm gives electronvolts directly; multiplying by 1.602176634×10⁻¹⁹ converts to joules. Frequency uses f = c/λ with c = 299 792 458 m/s and is shown in terahertz.

Does my screen change the result?

The numbers do not change, but the appearance can. Uncalibrated, wide-gamut and dark-mode displays render sRGB values differently. Treat the swatch as an approximate visualization and the hex value as the portable artifact.

Can I compare two wavelengths?

Yes. Save up to four markers with the Save marker button. The tool reports the nearest spacing between saved wavelengths, and each chip restores its wavelength when clicked.

What units does the numeric input accept?

The nm field accepts a plain number or a value with 'nm'; the µm field accepts micrometres such as 0.589 (µm and um are both accepted). A bare number in the nm field is always interpreted as nanometers.

References & standards