DiffractionVizzard · Open-source browser-based simulation suite
Source CodeDocumentation
Launch Simulation → ← Texture Tomography
Module 01 · Simulation

X-ray Diffraction

Compute Debye–Scherrer powder diffraction patterns from crystallographic structure factors. Explore Bragg peak indexing, atomic form factors, and detector geometry — all in the browser.

Launch Simulation → ← Texture Tomography
X-ray diffraction rings illustration

How X-ray Diffraction Works

When monochromatic X-rays with wavelength λ strike a periodic crystal lattice, they scatter elastically from the electron density of each atom. In directions satisfying Bragg's law, contributions from successive atomic planes add constructively to produce sharp intensity maxima:

2 d sinθ = n λ

where d is the interplanar spacing, θ is the glancing angle, and n is the order. Each family of crystallographic planes (hkl) satisfies this condition at a distinct angle, producing a characteristic diffraction pattern that fingerprints the crystal structure.

Structure Factors and Form Factors

The amplitude scattered by a unit cell in direction (hkl) is the structure factor F(hkl), a coherent sum over all atoms in the cell:

F(hkl) = Σⱼ fⱼ(Q) · exp(2πi (h xⱼ + k yⱼ + l zⱼ))

Here fⱼ(Q) is the atomic form factor of atom j, which depends on the momentum transfer Q = 4π sinθ / λ and describes how efficiently the atom scatters at that angle. The simulator uses the standard Cromer–Mann parameterisation, tabulated for all natural elements.

In the Simulation

You can select a crystal structure from a built-in library of common materials — aluminium, copper, iron, silicon, NaCl, and others — or import a custom unit cell as a CIF file. Adjustable parameters include:

X-ray energy (4–150 keV, corresponding wavelength λ from 8.3 pm to 0.31 nm) · Detector distance and pixel size (simulating near-field to far-field geometry) · Display mode: full 2D detector image, polar ring plot, or integrated 1D intensity profile.
Click on any ring to display the d-spacing, Miller indices (hkl), and the reflection multiplicity for that Bragg peak.

In powder diffraction, all crystallite orientations are sampled uniformly, so Bragg peaks appear as complete concentric annular rings (Debye–Scherrer geometry). Ring radii encode the d-spacings; ring intensities encode the structure factor squared, weighted by multiplicity, Lorentz, and polarisation factors.