🌈

Diffraction Grating

d · sin(θₘ) = m · λ  ·  Resolving power R = mN  ·  Angular dispersion dθ/dλ = m / (d·cosθ)

Optics Wave Physics Spectroscopy Interferometry Fraunhofer
d (spacing)
θ for m = −2
θ for m = −1
θ for m = 00.00°
θ for m = +1
θ for m = +2
Resolving power R
Angular disp. dθ/dλ
FSR Δλ (m=1)
Max visible order

🌈 Diffraction Grating Physics

A transmission grating with N slits of spacing d and slit width a produces a far-field (Fraunhofer) intensity pattern:

I(θ) = I₀ · [sin(β/2)/(β/2)]² · [sin(Nδ/2) / (N·sin(δ/2))]²

where β = 2πa·sin(θ)/λ (single-slit envelope phase) and δ = 2πd·sin(θ)/λ (inter-slit phase difference).

  • Principal maxima (grating equation): d · (sin θᵢ + sin θₘ) = m · λ  for m = 0, ±1, ±2, …
  • Resolving power: R = mN — smallest resolvable wavelength difference Δλ = λ / (mN)
  • Angular dispersion: dθ/dλ = m / (d · cos θₘ) — higher orders disperse more
  • Free spectral range: Δλ_FSR = λ / m — range before overlap of adjacent orders
  • Missing orders: when a/d = 1/k (integer k), grating maxima at those orders are suppressed by the single-slit zero

White light mode overlays all visible wavelengths (380–740 nm), revealing the characteristic rainbow spectrum in each diffraction order — the principle behind spectrographs and CDs.

About Diffraction Grating Simulation

This simulation models the far-field (Fraunhofer) intensity pattern produced when coherent light passes through a multi-slit transmission grating. A GPU-accelerated GLSL shader computes the combined interference of N slits with spacing d, applying both the single-slit sinc-squared envelope and the multi-slit interference factor, so you can observe how principal maxima sharpen as N increases and how their positions obey the grating equation d · sin(θ) = mλ. Adjusting the wavelength, slit spacing, slit width, and number of slits reveals the resolving power R = mN, angular dispersion, and free spectral range in real time.

Diffraction gratings are the workhorse of modern spectroscopy: they separate light into its constituent wavelengths with far greater resolving power than a prism, and are found in astronomical spectrographs, laser tuning cavities, monochromators, and the iridescent surfaces of CDs and DVDs.

Frequently Asked Questions

What is the grating equation and what does each variable mean?

The grating equation d · sin(θm) = mλ describes exactly where constructive interference produces a bright principal maximum. Here d is the centre-to-centre spacing between adjacent slits (in nm), θm is the angle of the m-th order maximum measured from the grating normal, m is an integer called the diffraction order (0, ±1, ±2, …), and λ is the wavelength of light. When the path difference between light from adjacent slits equals an integer number of wavelengths, all N slits add in phase to produce a very bright, sharp peak.

How do I use the simulation controls to explore the grating equation?

Use the Lines / mm slider to change the slit spacing d (d = 1 000 000 / lines per mm, in nm) and watch the principal maxima move outward as d decreases. Adjust Wavelength λ to shift all order peaks simultaneously—longer wavelengths produce larger angles. Increase Number of slits N to make the peaks narrower and the resolving power higher, while the order stats chips update live. Switch to White Light mode to see each order fan into a rainbow spectrum, just as a real spectrometer does.

Why do some diffraction orders disappear (missing orders)?

A missing order occurs when the angle that would satisfy the grating equation for order m also happens to fall exactly on a zero of the single-slit diffraction envelope. The envelope has minima at sin(θ) = kλ/a (k = 1, 2, …), so an order is suppressed whenever d/a is an integer: for example if a = d/2 the m = ±2 orders vanish, if a = d/3 the m = ±3 orders vanish. Try setting the Slit width slider to 0.50 and notice the second orders are weakened; change it to see the effect shift.

What determines the resolving power, and why does it matter for spectroscopy?

The resolving power R = mN gives the smallest wavelength difference Δλ = λ/R that the grating can separate (Rayleigh criterion). It depends on the diffraction order m and the total number of illuminated slits N, not on the slit spacing itself. A grating with N = 1000 slits used in first order has R = 1000, meaning it can distinguish two spectral lines 0.55 nm apart at 550 nm; in second order R = 2000, resolving lines 0.28 nm apart. High-resolution spectrographs use echelle gratings operated in orders m = 10–100 to achieve R > 100 000 and separate isotope shifts or stellar radial-velocity signals of a few m/s.

How do CDs and DVDs act as diffraction gratings?

A compact disc has data pits pressed in a spiral track with a pitch of approximately 1600 nm (625 lines per mm), and a DVD has a pitch of about 740 nm (1351 lines per mm). When white light reflects from the aluminium layer beneath the polycarbonate, the tracks act as a reflection grating and diffract each wavelength to a slightly different angle—creating the characteristic rainbow sheen you see when you tilt the disc. The presets in this simulation include both CD (625 l/mm) and DVD (1351 l/mm) so you can compare how the tighter DVD tracks spread the spectrum over a larger angular range and push higher orders beyond θ = 90°, making them inaccessible.

Is a diffraction grating the same as Young's double slit?

A double slit (N = 2) is the simplest possible diffraction grating, but with only two slits the principal maxima are broad and weak fringes of equal brightness fill the gaps—the contrast between maxima and minima is only 4:1. With N slits the peak intensity grows as N² while the peak width narrows as 1/N, giving dramatically sharper and brighter lines with N − 2 faint secondary maxima between each principal maximum. Set N = 2 in the simulation and gradually increase it to see the transition: even at N = 10 the secondary maxima are already hard to see and the principal maxima are nine times narrower than at N = 2.

Who invented the diffraction grating and when?

The American astronomer David Rittenhouse made the first crude grating in 1785 by stretching hairs between two fine screws, observing the colour separation but not fully understanding it. The German physicist Joseph von Fraunhofer independently developed practical ruled gratings around 1821–1823, using them to measure the precise wavelengths of the dark absorption lines in the solar spectrum that now bear his name. Henry Augustus Rowland of Johns Hopkins University revolutionised the field in 1882 by building a ruling engine that could score 100 000 or more parallel grooves on speculum metal with sub-micron precision, producing concave gratings that focused and dispersed light simultaneously and enabled the first high-accuracy atomic wavelength atlas.

What related phenomena or simulations are connected to diffraction gratings?

Diffraction gratings are deeply connected to the double-slit experiment (N = 2 grating), single-slit diffraction (the envelope that shapes each order), and the Fabry-Perot interferometer (a cavity that also produces sharp transmission peaks via multi-beam interference but relies on reflection rather than transmission through multiple slits). In X-ray crystallography, crystal planes act as a 3-D grating satisfying Bragg's law nλ = 2d sin(θ), the natural extension of the grating equation to shorter wavelengths. The related simulations on this site include the Double Slit Experiment, Diffraction & Interference, and the Fabry-Perot Interferometer.

How are diffraction gratings manufactured and used in modern instruments?

Modern gratings are either mechanically ruled with a diamond stylus on a soft metal blank (master gratings) or photolithographically etched as holographic gratings, which have fewer periodic errors and lower scattered light. Replicas are mass-produced from the master in epoxy on glass or plastic. In instruments the grating sits in a spectrometer or monochromator where a collimating mirror sends parallel light onto it and a focusing mirror images the dispersed spectrum onto a CCD detector array. Applications include optical fibre wavelength-division multiplexing (WDM) demultiplexers, laser line selectors in tunable dye or Ti:sapphire lasers, synchrotron beamline monochromators for soft X-rays, and portable field spectrometers for environmental and agricultural sensing.

What are current research frontiers in diffraction grating science?

Active research areas include metasurface gratings—arrays of sub-wavelength resonant nano-antennas that manipulate the phase of reflected or transmitted light to realise blazed, polarisation-sensitive, or holographic gratings within a film only hundreds of nanometres thick. Chirped-pulse amplification (Nobel Prize 2018) relies on pulse-stretcher/compressor pairs of large-aperture gold-coated gratings that can handle petawatt laser pulses; improving their damage threshold is an open engineering challenge. In astronomy, volume phase holographic (VPH) gratings recorded in dichromated gelatin achieve diffraction efficiencies above 90% and are now standard in integral-field spectrographs on 8-metre telescopes. Photonic-integrated grating couplers on silicon chips are being developed for chip-scale LiDAR and lab-on-chip spectroscopy.