Diffraction Grating Calculator

Enter grating spacing (or lines/mm), diffraction order, and wavelength to find diffraction angles — or solve for any missing variable.

Inputs

d in nm
or
lines / mm
Integer; 0 = straight-through
Visible range: 380–700 nm

Results

Fill in the inputs and click Calculate

Summary

Enter grating spacing (or lines/mm), diffraction order, and wavelength to find diffraction angles — or solve for any missing variable.

How it works

  1. Enter the grating spacing d in nanometers, or the lines-per-mm value (the tool converts automatically).
  2. Select the diffraction order m (0, ±1, ±2, …).
  3. Enter the incident wavelength λ in nanometers.
  4. Click Calculate to get the diffraction angle θ for that order.
  5. Switch to "Solve for λ" mode to find the wavelength when you know the angle.
  6. The visible-spectrum bar shows where the wavelength falls in the 380–700 nm range.

Use cases

  • Predict the angle at which a laser beam will appear for a given diffraction order.
  • Identify an unknown wavelength by measuring the diffraction angle experimentally.
  • Design spectroscopy setups by comparing first-order and second-order separations.
  • Verify grating specifications when the lines/mm rating is known.
  • Teach and visualize the grating equation in optics coursework.

Frequently Asked Questions

Last updated: 2026-06-11 · Reviewed by Nham Vu