X-ray Bragg diffraction · crystallography
You cannot see atoms — so how do you measure the distance between the ions in a grain of salt, and could that atomic ruler possibly weigh out a whole mole?

▶ Run the simulationSee the measured result
Units: angstrom (NaCl (200) interplanar spacing)
How the lab tests it
Forward-model the founding crystallography experiment (Bragg, 1913). Shine monochromatic X-rays (Cu Kα, λ=1.5406 Å) on a stack of N=48 parallel atomic planes spaced d apart; the path difference between waves reflected off adjacent planes is 2d·sinθ, so the diffracted intensity I(θ)=sin²(Nφ/2)/sin²(φ/2) (φ=2π·2d·sinθ/λ) spikes only at the Bragg angles 2d·sinθ=mλ. Generate the diffractometer trace (d enters ONLY here, as the physical crystal), find the principal-maximum angles by threshold + parabolic sub-grid refinement, and invert each via d=mλ/(2·sinθ_m) — a formula that never contains d. Then set the cubic cell edge a=2d and recover N_A=Z·M/(ρ·a³) from the macroscopic density. Sweep the crystal spacing as a perturbation and run the transmission-grating law d·sinθ=mλ as a falsification control. ?world=bragg.
What it checks
Bragg's law 2d·sinθ=mλ — the NaCl (200) interplanar spacing d=2.820 Å recovered to ~1e-4 purely from the three peak angles (15.85°, 33.11°, 55.03°; the 4th order forbidden, sinθ>1), and tracking the input across d∈[2.0,4.0] Å. The result is decisive because the factor of 2 is physical: inverting the SAME peaks with the transmission-grating law d·sinθ=mλ (no ×2) recovers 2d=5.64 Å — wrong by exactly 2× — so only the pair-of-planes path difference is self-consistent. And the atomic ruler weighs a mole: the recovered cell edge a=2d=5.6402 Å feeds N_A=Z·M/(ρ·a³)=6.02e23 to within 0.07% of CODATA — the macroscopic-to-atomic bridge. Distinct from ?world=debroglie's electron diffraction (surface d·sinθ=λ, recovering the electron wavelength): Bragg reflects X-rays off 3-D volume planes to recover the lattice itself. The lab's first crystallography world.
Bragg's law, d-spacing & lattice-constant calculator
How far apart the atoms are, measured off an angle. Nobody has ever seen an atomic plane: you shine a monochromatic X-ray at a crystal, swing a detector until the reflection flares, and invert the angle — and that inversion is the whole of crystallography. The spacing is never typed into this page. It arrives either as a MEASUREMENT (an angle put through Bragg's law) or as an ASSEMBLY out of macroscopic quantities you can weigh: a cubic cell holding Z formula units of molar mass M at density ρ has edge a = (Z·M/(ρ·N_A))^(1/3), so a kitchen scale and a cube root fix a lattice constant with no diffraction in it anywhere. Those two rulers land 0.0247% apart for rock salt, which is not a defect — it is the four figures in ρ and M, and it is the reason the modern SI runs this chain backwards and DEFINES Avogadro's number instead of measuring it. Run it forwards and the same arithmetic weighs a mole from an angle: 6.017676e+23, the number this world's oracle pins at 6.0177e23, 0.0741% under CODATA. One box carries the world's rival: f is the path-difference multiplier, 2 because the path runs across a PAIR of planes and back, 1 if you mistake the crystal for a transmission grating — and fed the same measured peak the two answers differ by exactly two, which is a factor of eight once it is cubed into a mole. The measured-angle box defaults to 15.85157728042775°, and that is deliberate: it is the module's OWN m = 1 peak off its 0.01° scan, not the textbook 15.85°, so inverting it returns 2.8201002 Å and the page reports the +8.59e-8 rather than rounding it into agreement. Four things this page will not do — which reflections are extinct, the Kα₁/Kα₂ splitting, peak heights, and correcting the simulation above — are spelled out under the order census.
nλ = f·d·sin θ, f = 2 for Bragg planes · d = nλ/(f·sin θ) · n_max = floor(f·d/λ) · a = (Z·M/(ρ·N_A))^(1/3), d = a/2 · N_A = Z·M/(ρ·(2d)³)