Many slits, sharper than two
A diffraction grating is Young's double-slit experiment scaled up to hundreds or thousands of evenly spaced slits (or, in a reflective grating, evenly spaced grooves). Light diffracts at every slit and the transmitted wavefronts interfere; where they arrive in phase, the intensity spikes into a sharp, bright fringe, and everywhere else the huge number of slightly-out-of-phase contributions from all the other slits cancels almost completely. The result is a set of narrow, well-separated bright lines rather than the broad, fuzzy fringes a two-slit setup produces — more slits means each bright line is enforced by more independent contributions that all have to agree, so any small phase mismatch destroys it.
The grating equation
Constructive interference — a bright fringe, or order — occurs wherever the path-length difference between adjacent slits is an integer number of wavelengths:
d · sin(θ) = m · λ d = slit (groove) spacing = 1 / (lines per mm, converted to consistent units) θ = diffraction angle measured from straight-through m = order number: 0, ±1, ±2, ±3, ... λ = wavelength of the light
The m = 0 order is the undeviated straight-through beam, always present regardless of wavelength; m = ±1, ±2, ... are the diffracted orders, symmetric on either side. Because the equation solves for sin(θ), no order can exist beyond sin(θ) = 1, so a grating with widely spaced lines (small line density) supports more visible orders than a fine one, but a fine grating spreads the surviving orders out over a much wider angle — the trade-off between order count and angular dispersion.
Why the lines are so sharp: N-slit interference
The full intensity pattern from N evenly spaced slits is the double-slit pattern multiplied by an interference factor that depends on N:
I(θ) ∝ [ sin(N·φ/2) / sin(φ/2) ]², φ = (2π d / λ) · sin(θ)
At the exact angles satisfying the grating equation, φ is a multiple of 2π and this factor peaks at N², not N — the amplitudes from all N slits add constructively, and intensity scales with amplitude squared. Between orders, the ratio oscillates through N−2 small secondary maxima before the next principal maximum, and as N grows those secondary peaks shrink relative to the main ones and the main peaks narrow. This is precisely why a 1000-line grating gives razor-sharp spectral lines while a two-slit setup gives soft, wide fringes — both obey the same underlying path-difference condition, only the sharpness differs.
White light: turning a grating into a spectrometer
Since the grating equation depends on λ, feeding in white light spreads each non-zero order into a continuous rainbow, red bending furthest from centre (longer λ, larger θ) and violet least — the reverse ordering from a prism, which bends short wavelengths more due to normal dispersion in glass. This is the working principle of a grating spectrometer: measure the angle of a spectral line in a known order and the grating equation returns its wavelength directly, no calibration curve required beyond knowing d accurately. It is also why gratings, not prisms, dominate modern spectroscopy — their dispersion is linear and predictable, and line density can be chosen to trade resolution against free spectral range for the application at hand.
Frequently asked questions
Why are diffraction grating fringes so much sharper than double-slit fringes?
Both obey the same path-difference condition for constructive interference, but a grating's intensity peaks scale with N² (N = number of slits) while destructive interference from the many extra slits kills everything in between almost completely. A two-slit pattern has only two contributions to interfere, so its fringes stay broad and soft by comparison.
What limits how many orders a grating can produce?
The grating equation d·sin(θ) = mλ has no solution once mλ/d exceeds 1, since sine cannot exceed 1. A grating with widely spaced lines (small line density, large d) allows higher m before hitting that limit, while a fine grating spreads its few surviving orders over a wider angular range.
Why does a grating spread white light in the opposite order to a prism?
A grating's diffraction angle grows with wavelength directly from d·sin(θ) = mλ, so red light (longer λ) bends furthest. A prism instead relies on the glass's refractive index decreasing with wavelength (normal dispersion), which bends blue and violet light — the shorter wavelengths — furthest.
Try it live
Everything above runs in your browser — open Diffraction Grating and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Diffraction Grating simulation