Wavelength ↔ Frequency Calculator (with Medium)

Enter either wavelength or frequency, choose a medium (or set refractive index), then calculate. Private by design—everything runs locally in your browser.

Inputs

Symbol: λ. Provide λ or f (one is enough).
Symbol: f. Leave one of λ or f blank.
Wave speed: \( v = \dfrac{c}{n} \). Leave n empty to use the preset.

Results

Results will appear here.

Formulas Used

  • \( \lambda = \dfrac{v}{f} \)
  • \( v = \dfrac{c}{n} \) (electromagnetic waves in a medium)
  • \( T = \dfrac{1}{f} \) (period)
  • \( k = \dfrac{2\pi}{\lambda} \) (wavenumber)
  • \( E = h f = \dfrac{h c}{\lambda} \) (photon energy)

Constants used: \( c = 299\,792\,458 \,\text{m·s}^{-1} \), \( h = 6.62607015\times 10^{-34}\,\text{J·s} \), \( 1\,\text{eV} = 1.602176634\times10^{-19}\,\text{J} \).

Understanding the Relationship

Wavelength \( (\lambda) \) and frequency \( (f) \) describe the same wave in different ways. They are tied together by the wave speed \(v\): \( \lambda = v/f \). For electromagnetic waves (light, radio, microwaves), the speed in a material is \( v = \dfrac{c}{n} \), where \(c\) is the speed of light in vacuum and \(n\) is the material’s refractive index. That means when light enters a denser medium (larger \(n\)), the wavelength gets shorter while the frequency stays the same.

$$ \lambda = \frac{c}{n f} \quad\text{and}\quad f = \frac{c}{n \lambda} $$

In this calculator we also report the period \(T = 1/f\), the wavenumber \(k = 2\pi/\lambda\) (in rad·m\(^{-1}\)), and—for photons—the energy \(E = h f = \dfrac{h c}{\lambda}\) (shown in joules and eV). These are convenient if you work in optics, RF, or photonics.

Quick intuition & everyday examples

  • Visible light. A green laser at \( \lambda \approx 532\,\text{nm} \) in air (\(n \approx 1.00027\)) has \( f \approx \dfrac{c}{n\lambda} \approx 5.63\times 10^{14}\,\text{Hz} \) (about 563 THz). Its photon energy is \(E \approx 2.33\,\text{eV}\).
  • FM radio. A station at \(100\,\text{MHz}\) (\(1.0\times10^8\,\text{Hz}\)) has wavelength \( \lambda \approx \dfrac{c}{n f} \approx 3.0\,\text{m} \) in air.
  • Wi-Fi / microwaves. At \(2.4\,\text{GHz}\), \( \lambda \approx 12.5\,\text{cm} \) (in air). Higher frequency bands (e.g., \(5\,\text{GHz}\)) have proportionally shorter wavelengths.

Working across media

Because \( v = c/n \), choosing a medium (air, water, glass) or entering a custom \(n\) simply scales the wavelength: \( \lambda_{\text{medium}} = \lambda_0 / n \). Frequency does not change at an interface, which is why color (set by \(f\)) is preserved when light passes from air into glass—only the spacing between wave crests changes inside the material.

Units, ranges, and tips

Common wavelength units are nm, μm, mm, cm, and m; frequency is typically Hz, kHz, MHz, GHz, or THz. Visible light spans roughly \(400\text{–}700\,\text{nm}\) (\(\approx 430\text{–}750\,\text{THz}\)); infrared is longer wavelengths (lower \(f\)), ultraviolet is shorter (higher \(f\)). Radio covers kHz to tens of GHz with wavelengths from kilometers to millimeters. The calculator auto-scales results to readable units, and it uses exact CODATA constants: \( c = 299{,}792{,}458\,\text{m·s}^{-1} \) and \( h = 6.62607015\times10^{-34}\,\text{J·s} \).

When precision matters

Real materials are dispersive: \(n\) depends on wavelength and temperature. Our presets (air \(\approx 1.00027\), water \(\approx 1.333\), typical crown glass \(\approx 1.517\)) are great for estimates; for lab-grade work, enter your own \(n\) at the operating wavelength. Finally, note that the formulas here apply to electromagnetic waves. For sound or water waves you would use the appropriate wave speed \(v\) for that medium, not \(c/n\).

Frequently Asked Questions

Does the wavelength change in a medium?

Yes. Frequency stays the same when entering a medium, but wavelength becomes shorter by a factor of \(n\): \( \lambda_{\text{medium}} = \lambda_0 / n \).

Which units are supported?

Wavelength: nm, μm, mm, cm, m. Frequency: Hz, kHz, MHz, GHz, THz. The tool auto-scales output for readability.

What is “wavenumber”?

Wavenumber \(k\) measures how rapidly a wave oscillates in space: \(k=2\pi/\lambda\) (in rad/m).

Is the refractive index constant?

In reality, \(n\) depends on wavelength and temperature. For quick estimates, these presets are fine; for precision work, enter your own \(n\).

Is my data private?

Yes—everything runs locally in your browser; nothing is uploaded.

Explore more tools