Diffraction Grating Solver – Wavelength, Groove Spacing & Angle (d sinθ = mλ)

Use this free Diffraction Grating Solver to work the grating equation d sinθ = mλ in any direction — find the wavelength, the groove spacing from a lines-per-mm rating, or the diffraction angle for any order.

θ light in m = 1 grating

Formula

d sinθ = mλ  •  groove spacing from the rating: d = 1,000,000 ÷ (lines per mm) nanometres

Bright fringes appear where the extra path travelled by light from neighbouring grooves is a whole number of wavelengths. The larger the order m, the wider the spectrum is spread — but fewer orders fit before sinθ would exceed 1.

How to use

Worked example

A 600 lines/mm grating has d = 1,000,000 ÷ 600 = 1666.67 nm.
For λ = 550 nm in first order (m = 1): sinθ = 550 ÷ 1666.67 = 0.33, so θ = 19.27°.
Checking the other way: at θ = 20°, λ = 1666.67 × sin20° = 570.03 nm.

FAQ

Why do higher orders spread colours more?
From sinθ = mλ/d, doubling m doubles the sine for every wavelength, so the whole spectrum stretches over a wider range of angles. That is why spectrometers often work in second or third order for finer detail.

What limits the highest order I can see?
Since sinθ cannot exceed 1, the maximum order is m = d/λ (rounded down). For a 600 lines/mm grating and 550 nm light that is m = 3.

How is a grating different from a double slit?
A grating has thousands of grooves instead of two slits. The bright fringes sit at the same angles as the double-slit maxima, but they are far sharper and brighter because so many waves reinforce there.