Tilt an old compact disc toward a lamp and the silvery surface lights up with bands of color — a smear of rainbow that slides sideways as you tilt the disc, splits into stripes under a narrow bulb, and vanishes the moment you lay the disc flat. Nothing was painted onto that plastic. The rainbow is manufactured by the data itself: the disc's surface is carved into a spiral of microscopic grooves spaced about one and a half thousandths of a millimeter apart, and those grooves reflect light the way a yard of parallel mirrors would — each groove adding its own tiny contribution to a collective trick that sorts white light into its colors by angle. It is a different beast from the oily rainbow film that can appear on a stainless steel sink, which comes from a thin skin of material. On a CD, the color comes from structure alone.

A mirror that sorts light by angle

A compact disc works as a reflection diffraction grating. The mirror-like aluminum layer is not smooth; it carries a spiral track of pits, and the flat "lands" between them sit at slightly different depths. When a wavefront of white light strikes this periodic landscape, each groove scatters a little light in every direction. At most angles, the contributions from neighboring grooves arrive out of step and cancel each other. But for each wavelength there are special angles where the path difference between rays bouncing off adjacent grooves equals exactly one wavelength, or two, or three — and the wavelets from thousands of grooves all arrive in step and add up. Blue light, with its short wavelength, reaches that condition at a smaller angle than red light. The result is a fan: each direction away from the plain reflection corresponds to a different color.

Physicists recognized this almost immediately after the CD appeared, and teaching papers in the early 1990s used the disc as a cheap, mass-produced grating for classroom wavelength measurements. You are holding a precision optical instrument that also happens to hold an album.

Why the rainbow stripes repeat on both sides

Look carefully and the pattern is stranger than a single rainbow. In the center sits the ordinary mirror reflection — white, uncolored, called the zeroth order, where every wavelength reflects at the same angle by simple law-of-reflection geometry. Flanking it on each side are paired rainbow bands, then fainter ones farther out. These are the first and second diffraction orders: one groove-to-groove path difference, then two. Each band runs through the spectrum with violet nearest the plain reflection and red farther out — the opposite of how a glass prism bends light, where violet is deflected most. The CD quietly reverses the prism's rulebook.

The spacing of the grooves sets how widely the colors spread. A DVD, with tracks packed roughly twice as densely as a CD, flings its first-order rainbow noticeably farther from the reflection. Smaller spacing, bigger spread: the grating equation demands it.

The same tracks that store the data

There is an elegant economy here: the rainbow you see and the music the disc once carried are read by the same periodicity. A CD player focuses a laser onto the track and watches the reflected beam flicker as pits and lands slide past — an interference effect in miniature. The disc was engineered to be read by light from one precise direction. Shopped to by room light from every direction, the same engineered regularity produces the fan of color instead. It is worth pausing on the fact that a diamond's sparks of color come from bending light by different amounts inside the stone, while the CD produces color by interference between reflections from thousands of identical ridges. Two different roads from white light to a spectrum.

A quick look, without special equipment

A point-like source makes the cleanest show: a single bare LED or a distant streetlamp reflected in the disc returns not a dot but a row of colored dots, symmetric about the bright central reflection. A long fluorescent tube returns repeated colored images of the tube itself, stacked side by side like a misprint. Indoors under a broad soft window, the bands blur into a mother-of-pearl wash instead — many directions of light arriving at once, each producing its own fan, all overlapping. The disc becomes a different object in each kind of light, which is itself the lesson: diffraction rewards a source you can point at. If you want to explore the ordering of hues you find this way — where each color sits relative to its neighbors along the band — the same judgment is rehearsed in Hue Sorting, which asks you to rebuild a smooth spectral sequence from shuffled neighbors and rewards exactly the eye that can tell which way a gradient runs.

The tell that separates a grating rainbow from other rainbows is repetition. A soap film or a drop of oil shows one continuous drift of color, because its thickness varies smoothly and produces color for one reason at each spot. A grating shows the whole spectrum, then does it again, fainter, farther out — a signature of structure repeating at regular intervals. That repetition is why scientists care: a repeating spectrum is a measurement, not a decoration. On the day compact discs finally leave the last drawer for good, they will remain one of the most accessible precision gratings ever sold — a physics demonstration with a hole in the middle.

A CD's fan of light, drawn as directions
2nd orderspectrum1st orderspectrummirror reflectionspectrum1st orderspectrum2nd order

Left to right: faint second order, first order, plain white reflection, first order, faint second order. In each band, violet sits nearest the center and red farthest out — reversed from a prism.