Bragg's Law Calculator
Convert between interplanar spacing, diffraction angle, and wavelength.
Learn more
What it does
This calculator applies Bragg's law to interrelate the X-ray wavelength lambda, the interplanar spacing d, and the diffraction angle 2θ of a crystal. Pick whether you want d from a measured 2θ, 2θ from a known d, or d from the cubic relation using the lattice constant a and Miller indices (hkl). It serves XRD users, crystallographers, and materials students assigning peaks or planning powder diffraction experiments.
How it works
Bragg's law is n x lambda = 2 x d x sin(theta), where n is the diffraction order (usually 1), lambda the X-ray wavelength, d the spacing between lattice planes, and theta the Bragg angle; the measured angle is 2θ. For a cubic crystal, d(hkl) = a / sqrt(h^2 + k^2 + l^2) with lattice constant a in Angstrom. Wavelengths depend on the source: Cu Kα is 0.15406 nm, Co Kα 0.17902 nm, Mo Kα 0.071073 nm. Keep units internally consistent.
Worked example
With Cu Kα radiation (lambda = 0.15406 nm) a measured peak at 2θ = 28.44 degrees gives theta = 14.22 degrees, so d = 1 x 0.15406 / (2 x sin 14.22) = 0.3139 nm = 3.139 A. Conversely, for cubic BaTiO3 the (100) spacing is d = 4.01 / sqrt(1) = 4.01 A, which reflects at 2θ = 2 x arcsin(0.15406 / (2 x 0.401)) = 22.1 degrees. These conversions are exact inverses of each other.
When to use it
Use this tool to index unknown powder patterns, to check whether a suspected peak matches a known plane, or to pick a radiation that resolves closely spaced reflections. Remember that 2θ is the diffraction angle between incident and diffracted beams, not the incidence angle, and that higher orders (n = 2, 3) appear at larger 2θ for the same d. For cubic systems the (hkl) choice must be integers; non-cubic cells need the full d-spacing relation.
FAQ
- What is the difference between theta and 2θ?
- Theta is the Bragg angle, the angle between the incident beam and the reflecting lattice planes; 2θ is the angle measured on the diffractometer between the incoming and the diffracted beams, and it is what you read off the scan. Peak positions in an XRD pattern are reported as 2θ. Bragg's law uses theta, so always halve the measured 2θ before computing d.
- Which X-ray source should I choose?
- Cu Kα (lambda = 0.15406 nm) is the default and suits most inorganic powders; Co Kα (0.17902 nm) is preferred for ferromagnetic samples that fluoresce under Cu. Mo Kα (0.071073 nm) gives widely spaced peaks good for large unit cells. The choice changes 2θ for the same d, so keep the source consistent when comparing to a reference pattern.
- How do I get d from the lattice constant?
- For a cubic crystal use d(hkl) = a / sqrt(h^2 + k^2 + l^2), where a is the lattice constant in Angstrom and (hkl) are the Miller indices. A (100) plane in BaTiO3 with a = 4.01 A gives d = 4.01 A; a (110) plane gives 2.835 A. Then convert d to 2θ with Bragg's law. This mode skips needing a measured 2θ entirely.
- Why does my measured 2θ differ from the calculated value?
- A shift of a few tenths of a degree is normal and usually comes from sample displacement or a zero-offset in the diffractometer, both of which move every peak in the same direction. A shift that grows with angle points to a sample height error, while peaks that shift by different amounts mean the real lattice is strained or slightly doped relative to the reference you used. Calibrate against a standard such as silicon powder (111) at 28.44 degrees with Cu K-alpha before trusting small differences.