Diffraction Grating Calculator

Calculate Angle, Wavelength, or Grating Spacing

Enter the grating details and wavelength to instantly compute the diffraction angle or solve for other variables. Supports all major units.

Diffraction Grating Calculator
Calculate Angle, Wavelength, or Grating Spacing

About the Diffraction Grating Calculator

A diffraction grating is an optical element with a regular array of slits or grooves that disperses light by wavelength through the principle of interference. When a beam of light strikes the grating, each groove acts as a new source of secondary waves. These waves interfere constructively only at specific angles that satisfy the grating equation: d × sin(θ) = m × λ, where d is the distance between adjacent grooves (grating spacing), θ is the diffraction angle measured from the grating normal, m is an integer called the diffraction order, and λ is the wavelength of light. The grating spacing d is related to the groove density N (lines per millimetre) by d = 1/N mm = 10⁶/N nm. A grating with 600 lines/mm has d ≈ 1666.7 nm. Increasing the groove density narrows the grating spacing and disperses light more widely for the same wavelength and order, which is why high-density gratings (1200–3600 lines/mm) are used in high-resolution spectroscopy. Diffraction orders are integer multiples of the wavelength contribution. The zeroth order (m = 0) is simply specular reflection; no wavelength separation occurs. The first order (m = ±1) is typically where most of the diffracted energy appears and is the standard choice for spectroscopic analysis. Higher orders (m = 2, 3, …) provide greater angular dispersion at the cost of intensity and potential overlap with lower orders of shorter wavelengths. The maximum observable order is limited by the physical constraint that sin(θ) cannot exceed 1: m_max = floor(d / λ). For a 600 lines/mm grating and 500 nm light, d = 1666.7 nm, so m_max = floor(1666.7/500) = 3. Orders beyond this angle would require the diffracted beam to bend past 90° from the normal, which is physically impossible. Diffraction gratings are used throughout science and engineering. In spectroscopy, they separate the spectral components of a light source so individual emission or absorption lines can be identified and measured. Laser systems use gratings to select a specific wavelength or to compress ultrashort pulses. Astronomy spectrographs use echelle gratings to achieve extremely high resolution across a wide spectral range. This calculator helps you design grating-based optical systems or solve for unknown parameters when other quantities are known.

Diffraction Grating Examples

Explore real-world scenarios and see how the grating equation works in practice.

Given ValuesCalculated ResultScenario
N = 600 lines/mm, m = 1, λ = 532 nmθ ≈ 18.60°Green laser pointer (532 nm) on a 600 lines/mm grating at 1st order. The spot appears about 18.6° from the central beam.
N = 1200 lines/mm, m = 1, λ = 650 nmθ ≈ 51.26°Red light (650 nm) at 1st order on a 1200 lines/mm grating. The high groove density disperses red light to a wide angle of 51° even at first order.
N = 1000 lines/mm, m = 1, θ = 40°λ ≈ 642.8 nmReverse calculation: a spot observed at 40° on a 1000 lines/mm grating at 1st order corresponds to a wavelength of about 643 nm (red light).
N = 600 lines/mm, λ = 500 nmm_max = 3Maximum observable order for green-yellow light (500 nm) on a 600 lines/mm grating. Orders 4 and above would require sin(θ) > 1.

How to Use the Diffraction Grating Calculator

  1. Enter the grating density in lines per mm (e.g., 600 for a common holographic grating).
  2. Enter the diffraction order — use 1 for the first order, which carries the most energy.
  3. Enter the wavelength of light in nanometres if you want to find the diffraction angle; or enter the angle in degrees if you want to find the wavelength.
  4. Leave the field you want to solve for blank, then click Calculate.
  5. Click Reset to clear all fields, or use the example buttons to load preset scenarios.

Diffraction Grating FAQ

What is a diffraction grating?
A diffraction grating is an optical component with a periodic structure — typically parallel grooves etched onto a glass or metal surface — that diffracts light into its component wavelengths. It works by the principle of constructive interference: light from adjacent grooves adds in phase only at specific angles that satisfy the grating equation d × sin(θ) = m × λ.
What does grating spacing mean?
Grating spacing (d) is the distance between adjacent grooves, measured in the same units as the wavelength. It is the reciprocal of the groove density: d = 1/N. For a 600 lines/mm grating, d = 1/600 mm ≈ 1666.7 nm. Smaller d (more grooves per mm) spreads the spectrum more widely.
What is diffraction order?
The diffraction order (m) is an integer that describes how many full wavelengths of path-length difference separate adjacent groove contributions. Order 0 is the undiffracted central beam. Order ±1 is the first diffracted beam on either side. Higher orders appear at larger angles and carry less intensity for most grating types.
How do I find the maximum diffraction order?
The maximum order is constrained by sin(θ) ≤ 1, so m_max = floor(d / λ). Leave the Order field blank and enter Lines/mm and Wavelength; the calculator will report the maximum order automatically.
Why does my grating not produce a visible higher order?
Each grating has a blaze wavelength at which it diffracts most efficiently. Far from the blaze condition, higher orders may be very faint even if they are geometrically allowed. Additionally, if m × λ > d, the order is geometrically forbidden because it would require sin(θ) > 1.
What are transmission versus reflection gratings?
Transmission gratings disperse light as it passes through the grooved substrate; reflection gratings work like mirrors with fine parallel grooves. Both obey the same grating equation. Reflection gratings are more common in spectroscopy because they can be blazed for high efficiency and work across a very broad spectral range without the absorption limitations of glass.