Diffraction Grating Calculator

A diffraction grating is an optical element with a periodic array of slits or grooves that disperses light into its component wavelengths. The grating equation d sin(theta) = m lambda relates the grating spacing d, the diffraction angle theta, the order m, and the wavelength lambda. You can solve for any one of these: find the angle at which a given wavelength appears, or determine the wavelength from a measured angle. This calculator lets you choose what to solve for. Diffraction gratings are used in spectrometers, monochromators, laser pulse compressors, and wavelength division multiplexing (WDM) in fiber optics. Enter the grating specification (lines/mm or spacing in nm) to get started.

Common: 300, 600, 1200, 1800 lines/mm
Integer: 1, 2, 3 (use 1 for first order)
Visible light: 380 to 750 nm
19.27 deg
1,666.67 nm

Grating equation

d sin(theta) = m lambda

Where d is the grating spacing (nm or um), theta is the diffraction angle, m is the integer order, and lambda is the wavelength. Solving for angle: theta = arcsin(m lambda / d). Solving for wavelength: lambda = d sin(theta) / m.

How diffraction gratings work

  • Light incident on a grating is reflected or transmitted from each groove. When path length differences equal integer multiples of the wavelength, constructive interference produces bright diffraction maxima.
  • The angular dispersion dtheta/dlambda = m / (d cos theta) increases with order m and decreases with grating spacing d.
  • Blazed gratings concentrate more diffracted energy into a specific order by shaping each groove at a specific blaze angle.
  • Resolving power R = mN, where N is the total number of illuminated grooves, determines how finely wavelengths can be separated.

Diffraction grating: frequently asked questions

What is the diffraction grating equation?

The grating equation is d sin(theta) = m lambda, where d is the grating spacing (distance between adjacent slits or grooves), theta is the diffraction angle, m is the diffraction order (integer: 0, 1, 2, ...), and lambda is the wavelength. It describes where constructive interference maxima appear.

What is grating spacing and how is it related to lines/mm?

Grating spacing d is the center-to-center distance between adjacent grating lines. If a grating has N lines per millimeter, then d = 1/N mm = (1000/N) micrometers. For example, 600 lines/mm gives d = 1.667 micrometers.

What is diffraction order?

The diffraction order m is an integer that labels each constructive interference maximum. Order m=0 is the straight-through beam (no dispersion). Order m=1 is the first-order diffracted beam, m=2 is the second order, and so on. Higher orders appear at larger angles and have greater angular dispersion but lower intensity.

Why is the first order (m=1) most commonly used in spectroscopy?

The first diffraction order provides a good balance between angular dispersion (spreading wavelengths apart) and diffracted intensity. Higher orders disperse wavelengths more but have progressively lower efficiency and risk overlap between different orders.

What limits the maximum wavelength a grating can diffract?

The maximum diffraction angle is 90 degrees (sin = 1), so the maximum wavelength for a given order is lambda_max = d/m. For example, a 600 lines/mm grating (d = 1.667 um) in first order can diffract up to 1,667 nm wavelength.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 15 June 2026. See our methodology.