A crystal is a diffraction grating you can't see
A crystal is atoms arranged in a repeating, periodic lattice, and that periodicity is exactly what a diffraction grating needs — regularly spaced scattering centres separated by a distance comparable to the wavelength of the incoming wave. Visible light's wavelength is far too long to notice atomic spacing (typically a few tenths of a nanometre), but X-rays sit right in that range. Shine X-rays on a crystal and each atom scatters a little bit of the beam; the scattered waves from the whole lattice interfere, and at almost every angle they cancel out completely. At a handful of very specific angles, they add up into a sharp, bright spot.
Bragg's picture: reflection off parallel planes
In 1913, William Lawrence Bragg (with his father William Henry Bragg) found a beautifully simple geometric way to predict exactly which angles produce a bright spot. Instead of tracking every atom individually, group the lattice into families of parallel planes spaced a distance d apart, and treat each plane as a partial mirror. An incoming X-ray beam partially "reflects" off each plane at the same angle θ it arrived at (just like a mirror), and the ray that reflects off the second, deeper plane travels an extra distance before it re-joins the ray that reflected off the first plane.
extra path length = 2·d·sin(θ) (geometry of two parallel planes, spacing d) BRAGG'S LAW: n·λ = 2·d·sin(θ) n = integer diffraction order (1, 2, 3, …) λ = X-ray wavelength d = spacing between the parallel lattice planes θ = angle of incidence, measured from the PLANE (not the normal)
When that extra path exactly equals a whole number of wavelengths, the two reflected waves emerge in phase and interfere constructively — the crystal "lights up" at that angle. At every angle where the extra path is a fractional number of wavelengths, the reflections from successive planes destructively interfere and the intensity drops to essentially zero. This is why a Bragg diffraction pattern is a set of sharp, discrete spots rather than a smooth glow: only a handful of (d, θ) combinations satisfy the law for a given λ.
Miller indices: naming the planes
A crystal lattice contains infinitely many families of parallel planes, cut at every conceivable orientation through the atoms, and each family has its own characteristic spacing d. Crystallographers label each family with three integers (h k l), the Miller indices, which describe how the plane intersects the unit cell's three axes. For a simple cubic lattice of side a, the spacing of the (h k l) planes has a clean closed form:
d(hkl) = a / √(h² + k² + l²) (cubic lattice, side length a)
Every diffraction spot in a pattern corresponds to a specific (h k l) plane family. Measuring the angle of each spot gives d for that family via Bragg's law, and from the full set of d-spacings a crystallographer can work backward to the lattice's unit cell dimensions and symmetry — the geometry of the atomic arrangement, before even asking what atoms sit where within it.
Intensity: the structure factor
Bragg's law tells you where the spots appear; it says nothing about how bright each one is. Brightness is governed by the structure factor F(hkl), a sum over every atom in the unit cell of its scattering power weighted by a phase factor that depends on the atom's position. Atoms scatter X-rays roughly in proportion to their electron count, so heavy atoms dominate the structure factor and light atoms (notably hydrogen) are notoriously hard to locate from X-ray data alone. Certain symmetric arrangements make specific (h k l) reflections cancel out entirely regardless of what the atoms are — these systematic absences are themselves a direct fingerprint of the crystal's space-group symmetry.
From spots to structure: the phase problem
A detector records only the intensity of each diffraction spot — proportional to |F(hkl)|² — and loses the phase of the scattered wave entirely. Reconstructing the electron density map (and from it, the atomic positions) via a Fourier transform needs both amplitude and phase, so recovering the missing phase, the famous phase problem, is the central technical challenge of crystallography. Solutions include direct methods (exploiting known mathematical constraints on physically valid electron densities for small molecules), isomorphous replacement and anomalous scattering (comparing patterns from crystals with and without a heavy-atom marker), and molecular replacement (using a known, similar structure as a starting phase estimate) — the toolkit that turned X-ray diffraction from a curiosity into the technique behind the structures of DNA, haemoglobin, and most of the proteins in the Protein Data Bank.
Frequently asked questions
What does nλ = 2d·sin(θ) actually mean?
It is the condition for constructive interference between X-rays reflecting off successive parallel planes of atoms spaced d apart. The extra distance the ray reflecting off the deeper plane travels is 2d·sin(θ); when that extra path equals a whole number of wavelengths n, the reflected waves stay in phase and add up to a strong signal. At every other angle they cancel.
Why are X-rays used instead of visible light?
Bragg's law only produces sharp, informative diffraction when the wavelength is comparable to the spacing between atomic planes, roughly 0.1-nanometre scale. Visible light's wavelength (400-700 nm) is thousands of times too large to resolve that spacing; X-rays sit in the right range, which is why X-ray crystallography, not optical microscopy, is used to solve atomic structures.
How do you go from a diffraction pattern back to a structure?
Each spot's position gives a Miller-indexed lattice plane and its spacing d; its intensity depends on the structure factor, which encodes where the atoms sit within the unit cell and what they are. Reconstructing the electron density from the full set of intensities requires also recovering the phase of each reflection — the famous phase problem — solved in practice with methods like molecular replacement, isomorphous replacement, or direct methods.
Try it live
Everything above runs in your browser — open Bragg Diffraction and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Bragg Diffraction simulation