Diffraction and Diffraction Gratings: The CD Rainbow
Tilt an old CD under a lamp and a rainbow sweeps across it - no prism, no oil film, just a spiral of microscopic pits. That rainbow is diffraction: light waves bending around a fine periodic structure and interfering so that each color emerges at its own angle. The same effect runs the spectrometers that read the chemistry of distant stars. This is the interactive guide to splitting light with structure.
Light bending around structure
Light is a wave, and waves diffract - they bend and spread when they pass an edge or a gap comparable to their wavelength. Send light through (or off) a structure with many regularly spaced slits or grooves and something remarkable happens: the wavelets from each opening overlap and interfere. They cancel almost everywhere, and add up only in a few sharp directions.
Crucially, those reinforcing directions depend on wavelength. Red waves, being longer, reinforce at a bigger angle than blue. So white light fans out into a spectrum, sorted by color - without any prism. That is the principle of the diffraction grating, and it is a different mechanism from the refraction of a prism and from the thin-film interference of a soap bubble.
The grating, color by angle
The whole behaviour is captured by the grating equation: d sin θ = m λ, where d is the spacing between lines, θ is the angle of the diffracted beam, λ is the wavelength, and m is the order (1, 2, ...). Closer lines (smaller d) throw each color out to a wider angle. Change the line density and watch the spectrum fan open or close.
Finer lines spread the colors wider
A white beam strikes a grating; the first-order spectrum fans out to either side, each wavelength at the angle the grating equation demands. Increase the line density (lines per millimetre) and the spectrum spreads wider - the basis of how a spectrometer separates colors. The readout gives the angle of red and violet.
Why a CD makes a rainbow
A CD is an accidental, excellent reflection grating. Its data spiral is a track of pits spaced about 1.6 µm apart - roughly 625 lines per millimetre. White light bouncing off it diffracts into a spectrum, which is why a CD flashes rainbow colors that slide as you tilt it. A DVD packs its tracks tighter (about 0.74 µm, ~1350 lines/mm), so it spreads the colors even more. Compare them.
CD, DVD, and the tilt
A reflective disc lit from one side. Choose CD (wider track, narrower rainbow) or DVD (tighter track, wider rainbow), and tilt it: the angle at which each color reinforces moves, so the rainbow sweeps across the surface. The finer DVD grating throws a noticeably broader band of color.
Diffraction orders
The m in the grating equation is the order. At m = 0 all wavelengths pass straight through undeviated - a white central beam. At m = ±1 you get the first spectrum either side; at m = ±2 a second, wider spectrum; and so on. Higher orders are dimmer and spread more, and at some point they begin to overlap - a real headache for spectrometer designers. Step through the orders.
One grating, many spectra
The same grating, showing orders up to the number you choose. Order 0 is the undeviated white spot; each successive order is a spectrum spread wider than the last. Push it far enough and the high orders begin to overlap, where red of one order meets violet of the next.
Grating versus prism
Both a prism and a grating turn white light into a spectrum, but they are opposites. A prism refracts, bending shorter wavelengths (violet) the most, with a squeezed, nonlinear spread. A grating diffracts, deflecting longer wavelengths (red) the most, with a spread nearly linear in wavelength - and it makes several orders. See the two spectra reversed against each other.
The spectrum, reversed
White light into each device, the spectrum it produces below. Notice the order flips: the prism bends violet furthest (violet at the wide end), the grating bends red furthest (red at the wide end). The grating's spectrum is also more evenly spaced - more linear in wavelength.
Where diffraction shows up
Pitfalls and gotchas
Test your understanding
Six questions on diffraction, the grating equation, the CD rainbow, orders, and grating vs prism. Instant feedback, no scores recorded - a wrong answer comes with a short explanation.
Quick check
Continue your journey
Diffraction is one of three ways structure and waves make color. Follow the others.
The Physics of Light, Wavelength, and Spectrum
Refraction and dispersion - the prism side of making a spectrum.
Physics · 54Thin-Film Interference and Iridescence
The other interference color - from two surfaces, not many grooves.
Physics · 50Polarization and Color
Yet another wave property that makes and reveals color.
Physics · 40Color in Nature: Sky, Rainbows, Atmosphere
Where structural and atmospheric color show up in the wild.
Physics · 33How Colorants Work: Pigments, Dyes, Structural Color
Grating-like nanostructures among nature's structural colors.
Physics · SPDSpectral Power Distributions and Why RGB Is Not Enough
What a grating spectrometer actually measures.