X-ray crystallography is a technique in crystallography in which the pattern produced by the diffraction of x-rays through the closely spaced lattice of atoms in a crystal is recorded and then analyzed to reveal the nature of that lattice.

The material and molecular structure of a substance can often be inferred by quantitative study of this pattern. It is widely used in chemistry and biochemistry to determine the structures of molecules, including DNA and proteins. X-ray crystallography played a major role in elucidating the double-helix structure of DNA. See Rosalind Franklin, James Watson, Francis Crick.

To determine a structure, the substance must first be crystallized. This can be a painstaking procedure for macromolecules such as DNA. Then the crystals are harvested and often frozen with liquid nitrogen to prevent them from cracking. Crystals are placed on a diffractometer[?], a machine that emits a beam of x-rays. The x-rays diffract off the electrons in the crystal, and the pattern of diffraction is recorded on film and scanned into a computer.

The molecule must be crystallized because one photon diffracted by one electron cannot be reliably detected. However, because of the regular crystalline structure, the photons are diffracted by corresponding electrons in many symmetrically arranged molecules. Because waves of the same frequency whose peaks match reinforce each other, the signal becomes detectable.