Diffraction Grating Calculator – Angle for Each Order d sinθ = mλ

Use this free Diffraction Grating Calculator to find the angle at which a grating sends light of a given wavelength for any order of the spectrum — the tool behind spectroscopes and CD rainbow effects.

m = 0 m = 1 m = 2 grating

Formula

d sinθ = mλ, so θ = sin−1(mλ / d)  •  d is the spacing between neighbouring lines: d = 1 ÷ (lines per metre)

A grating with 500 lines/mm has d = 1/500 mm = 2.00 × 10−6 m = 2000 nm. The largest possible order is mmax = d ÷ λ (rounded down), because sinθ can never exceed 1.

How to use

Worked example

A grating with 500 lines/mm is lit by orange light of wavelength 600 nm. The line spacing is d = 2000 nm.
For the first order (m = 1): sinθ = (1 × 600) ÷ 2000 = 0.300
θ = sin−1(0.300) = 17.46°.
The highest order that can exist is m = 2000 ÷ 600 = 3.33, so orders up to m = 3 appear.

FAQ

Why does a grating spread white light into colours?
The angle depends on the wavelength: red light (long λ) is deflected more than blue light (short λ). Each order is therefore a full little spectrum, which is exactly what a spectroscope uses to analyse light from stars and chemicals.

Why do some orders go missing?
If mλ/d is greater than 1, sinθ would have to exceed 1, which is impossible — that order simply does not exist. Finer gratings (smaller d) show fewer, more widely spread orders.

Is a CD or DVD a diffraction grating?
Yes! The spiral track acts like thousands of tiny lines (about 625 lines/mm on a CD). That is why white light reflecting off a disc breaks into rainbow colours at particular angles.