Bragg’s Law Calculator for X-ray diffraction. Solve 2θ, d-spacing, wavelength or order from nλ = 2d sin θ, list crystal (hkl) peaks, and get the crystallite size from a peak width.
Pick an X-ray tube in the wavelength menu, or type your own value in Å, nm or pm.
Crystallite Size (Scherrer)
Step-by-Step Working
- d = 3.1356 Å
- λ = Cu Kα1 (1.54056 Å)
- sin θ = nλ ÷ 2d = 1 × 1.54056 ÷ (2 × 3.1356) = 0.245656
- θ = arcsin(0.245656) = 14.2206°
- 2θ = 2 × 14.2206° = 28.441°
Orders for This Plane
| Order n | θ (°) | 2θ (°) | Path 2d sin θ (Å) |
|---|---|---|---|
| Yours · 1 | 14.22 | 28.44 | 1.541 |
| 2 | 29.43 | 58.85 | 3.081 |
| 3 | 47.47 | 94.95 | 4.622 |
| 4 | 79.3 | 158.6 | 6.162 |
Bragg Geometry
Bragg’s Law Calculator Formula
The Bragg’s law calculator links four numbers in X-ray diffraction. They are the wavelength of the beam, the spacing between atomic planes in a crystal, the angle of the beam to those planes and the order of the reflection. Bragg’s law ties them together in one short equation.
$$n\lambda = 2d \sin\theta$$
Here λ is the X-ray wavelength, d is the interplanar spacing and θ is the Bragg angle between the beam and the planes. The n in Bragg’s law is the order of the reflection, a whole number such as 1, 2 or 3 that counts how many wavelengths fit into the extra path between neighboring planes.
The calculator solves for any one of these from the other three. Each rearranged form comes straight from the equation above.
$$\theta = \arcsin\left(\frac{n\lambda}{2d}\right) \qquad d = \frac{n\lambda}{2\sin\theta} \qquad \lambda = \frac{2d\sin\theta}{n}$$
Worked Example: Silicon (111)
The tool loads with the (111) planes of silicon, spaced 3.1356 Å apart, and Cu Kα1 radiation at 1.54056 Å. For the first order, sin θ = 1.54056 ÷ (2 × 3.1356) = 0.24565.
$$\theta = \arcsin(0.24565) = 14.22^\circ \qquad 2\theta = 28.44^\circ$$
So the silicon (111) peak appears at 28.441° 2θ on a Cu diffractometer. The silicon lattice constant behind that spacing, about 5.431 Å, is listed in the NIST CODATA table as 5.431020511 Å.
Bragg’s Law Derivation
Picture two parallel rows of atoms a distance d apart. A wave reflecting from the lower plane travels farther than one reflecting from the upper plane. Simple geometry shows the extra distance is d sin θ on the way in and d sin θ on the way out.
The two reflected waves add up only when that extra path, 2d sin θ, equals a whole number of wavelengths. If it does not, waves from the many planes in a crystal cancel. That condition is Bragg’s law. The Bragg Geometry panel in the tool draws it for your numbers, a simple simulation of the two rays and the planes they reflect from.
Why XRD Uses 2θ
A diffractometer measures the angle between the incoming beam and the diffracted beam. That angle is twice the Bragg angle, so XRD patterns plot intensity against 2θ rather than θ.
The Bragg’s law calculator accepts the angle either way. Set the unit to ° 2θ for a value read straight from an XRD pattern, or to ° θ for the half angle. The hero result always shows both.
How to Convert 2θ to d-Spacing
To get a d-spacing from a peak, halve the 2θ value, take its sine, then divide the wavelength by twice that sine. Pick d-Spacing under Solve For and the Bragg’s law calculator works as a d-spacing calculator, showing each step.
$$d = \frac{\lambda}{2\sin(2\theta / 2)}$$
A peak at 28.443° 2θ with Cu Kα1 gives d = 1.54056 ÷ (2 × sin 14.2215°) = 3.1354 Å. That matches the silicon (111) spacing, which is how a single peak can point to a known phase.
Bragg’s Law in Excel
For a column of peaks, the same steps fit in one Excel formula. With 2θ in cell A2 and the wavelength in Å in B2, this returns d in Å.
=B2/(2*SIN(RADIANS(A2/2)))
To go the other way, from d in C2 to the 2θ peak, use =2*DEGREES(ASIN(B2/(2*C2))). Both formulas assume n = 1, which is how modern XRD indexing treats every peak.
Crystal Peaks and d-Spacing
For a cubic crystal with lattice constant a, the spacing of the (hkl) planes depends only on the Miller indices. Pick Crystal (hkl) Peaks to use it, then enter the lattice type, a and h, k and l.
$$d_{hkl} = \frac{a}{\sqrt{h^2 + k^2 + l^2}}$$
Not every (hkl) gives a peak. In centered lattices, waves from the extra atoms cancel some reflections. The tool applies these selection rules and marks a forbidden reflection as absent, even when Bragg’s law alone would allow its angle.
| Lattice | Allowed (hkl) | First Reflections |
|---|---|---|
| Simple cubic | All | 100, 110, 111, 200 |
| Body-centered (BCC) | h + k + l even | 110, 200, 211, 220 |
| Face-centered (FCC) | All odd or all even | 111, 200, 220, 311 |
| Diamond cubic | All odd, or all even with h + k + l = 4n | 111, 220, 311, 400 |
| Body-centered tetragonal | h + k + l even | 101, 002, 110, 112 |
| HCP / wurtzite | All except h + 2k = 3n with l odd | 100, 002, 101, 102 |
Silicon is diamond cubic, so its (200) reflection is missing and (222) is forbidden in the ideal structure, even though FCC lattices show both. The table lists silicon’s first peaks with a = 5.431 Å, for both common tube targets.
| (hkl) | h² + k² + l² | d (Å) | 2θ, Cu Kα1 | 2θ, Mo Kα1 |
|---|---|---|---|---|
| 111 | 3 | 3.1356 | 28.44° | 12.99° |
| 220 | 8 | 1.9201 | 47.30° | 21.29° |
| 311 | 11 | 1.6375 | 56.12° | 25.02° |
| 400 | 16 | 1.3578 | 69.13° | 30.28° |
| 331 | 19 | 1.2460 | 76.37° | 33.08° |
| 422 | 24 | 1.1086 | 88.03° | 37.32° |
| 511 / 333 | 27 | 1.0452 | 94.95° | 39.67° |
The (511) and (333) planes share h² + k² + l² = 27, so they land on the same peak. The tool’s peak table groups such planes in one row and runs up to the last peak your wavelength can reach.
Hexagonal and Tetragonal Crystals
Many common XRD samples are not cubic, so the spacing also depends on a second lattice constant, c. Pick a tetragonal or hexagonal lattice type and a c field appears next to a. The tool then uses the matching formula for 1/d².
$$\frac{1}{d^2} = \frac{h^2 + k^2}{a^2} + \frac{l^2}{c^2} \qquad \frac{1}{d^2} = \frac{4}{3} \cdot \frac{h^2 + hk + k^2}{a^2} + \frac{l^2}{c^2}$$
The first form is tetragonal and the second is hexagonal. For hexagonal crystals the steps also give the four-index Miller-Bravais form (h k i l), where i = −(h + k).
Zinc oxide has the wurtzite structure with a = 3.250 Å and c = 5.207 Å, the tool’s sample values for the HCP / wurtzite type. Its (001) reflection is absent, which the tool flags, so the first peaks are (100), (002) and (101).
| ZnO (hkl) | d (Å) | 2θ, Cu Kα1 |
|---|---|---|
| 100 | 2.8146 | 31.77° |
| 002 | 2.6035 | 34.42° |
| 101 | 2.4760 | 36.25° |
| 102 | 1.9112 | 47.54° |
| 110 | 1.6250 | 56.59° |
| 103 | 1.4773 | 62.85° |
| 112 | 1.3785 | 67.94° |
Indium is body-centered tetragonal with a = 3.2523 Å and c = 4.9461 Å, and its strongest (101) peak lands at 32.93° 2θ. The tool applies the lattice-centering and HCP rules only, so in phases with glide or screw symmetry, such as rutile or anatase, a few listed peaks may be missing from a real scan.
Reading the Bragg’s Law Result Cards
Beyond the peak position, the Bragg’s law calculator adds four cards. They cover the higher orders, the beam energy, crystallite size and how the same plane looks with the other common tube.
Possible Orders
Because sin θ cannot exceed 1, n can only go up to 2d ÷ λ. For silicon (111) with Cu Kα1 that is 4.07, so four orders are possible. The second appears at 58.85° 2θ and the fourth at 158.6° 2θ.
$$n_{max} = \left\lfloor \frac{2d}{\lambda} \right\rfloor$$
In practice, a second-order (111) reflection is treated as the (222) reflection with half the spacing. In Crystal (hkl) mode the card counts only the orders the lattice allows, which is why silicon shows fewer.
Photon Energy and Scattering Vector
Card 2 converts the wavelength to photon energy with E = hc ÷ λ, where hc = 12.3984 keV·Å. Cu Kα1 works out to 8.048 keV and Mo Kα1 to 17.48 keV.
The same card gives the scattering vector q = 4π sin θ ÷ λ, which equals 2π ÷ d at the Bragg condition. It also gives sin θ ÷ λ, the value crystallography tables use to look up atomic scattering factors.
Cu vs Mo and the Kα Doublet
Card 4 shows where the same plane diffracts with the other common tube. Silicon (111) moves from 28.44° 2θ with copper to 12.99° 2θ with molybdenum, because the shorter Mo wavelength squeezes every peak to lower angles.
As a Bragg’s law calculator for X-ray work, the tool includes both tubes as presets in the wavelength menu. Each tube emits two close lines, Kα1 and Kα2, so peaks split slightly at higher angles. The card gives that split, 0.0722° 2θ for Cu at the silicon (111) peak. The wavelengths the tool uses match the table published by the University of Pennsylvania X-ray facility.
| Tube Line | Wavelength (Å) | Photon Energy (keV) |
|---|---|---|
| Cu Kα1 | 1.54056 | 8.048 |
| Cu Kα2 | 1.54439 | 8.028 |
| Cu Kα (average) | 1.54184 | 8.041 |
| Mo Kα1 | 0.70930 | 17.48 |
| Mo Kα2 | 0.71359 | 17.37 |
| Mo Kα (average) | 0.71073 | 17.44 |
Use the Kα average when your pattern does not resolve the doublet, which is common at low angles. Use Kα1 when the Kα2 line has been stripped or the peaks are clearly split.
Crystallite Size From XRD
Small crystals give broader peaks. The Scherrer equation turns the full width at half maximum (FWHM) of a peak into an average crystallite size τ. Open Crystallite Size (Scherrer) in the tool to use it.
$$\tau = \frac{K\lambda}{\beta\cos\theta}$$
K is a shape factor, 0.9 by default, and β is the FWHM in radians of 2θ. For the silicon (111) peak with a 0.2° FWHM, the result is 40.98 nm, or about 131 (111) planes across each crystallite.
To find the FWHM, read the peak height, halve it, and measure the peak’s width in 2θ at that half height. Your diffractometer also widens every peak, so measure its own width on a standard with large crystals.
Enter that figure in the Instrument Width (FWHM) field. The tool removes it before the size step, using the usual correction for Gaussian-shaped peaks.
$$\beta = \sqrt{\beta_{obs}^2 – \beta_{inst}^2}$$
With a 0.2° observed width and, say, a 0.08° instrument width, the sample width drops to 0.1833° and the size rises from 40.98 nm to 44.71 nm. The card’s second row then shows that corrected width in place of the spacing spread.
The method works best for crystallites below about 100 to 200 nm. Above that, the instrument sets most of the width and the tool flags the result. Strain also broadens peaks, so a large spread in d can be mistaken for small size.
Limitations of Bragg’s Law
Bragg’s law gives where peaks can appear, not how strong they are. Peak intensity depends on which atoms sit in the cell and where, which is why forbidden reflections vanish even when the angle fits.
It also treats the crystal as perfect, flat sets of planes that each scatter the beam once. Real crystals have defects, strain and finite size, which shift and broaden peaks. And diffraction is only possible when the wavelength is no longer than 2d, so very long waves give no peaks at all.
Bragg’s Law FAQs
These answers cover the questions people search most often about Bragg’s law and XRD. Each figure comes from the same formulas the Bragg’s law calculator runs.
Who proposed Bragg’s law?
William Henry Bragg and his son William Lawrence Bragg developed it in 1912 and 1913, using X-rays reflected from crystals. They shared the 1915 Nobel Prize in Physics for their analysis of crystal structure by X-rays, as recorded by the Nobel Prize site.
The law is also called the Bragg equation or the Bragg condition, and θ is called the Bragg angle. It should not be confused with Bragg’s rule, a separate result about how materials slow down charged particles.
What is the principle of XRD?
XRD shines a beam of X-rays of one known wavelength on a sample and records the diffracted intensity at each angle. Each family of planes reflects strongly only at its own Bragg angle, so the peak positions give the d-spacings.
The set of d-spacings acts as a fingerprint of the crystal structure. Comparing it with reference patterns identifies the phases present, and the peak widths and shifts reveal size and strain.
How do you read XRD results?
An XRD diagram plots intensity on the vertical axis against 2θ on the horizontal axis. Start by listing the 2θ of each peak and converting each one to d with Bragg’s law.
Then match the d-spacings and their relative heights to a reference pattern to identify the phase. Finally, check the peak widths for crystallite size and any shifts from the reference for strain or changes in lattice constant.
What is the 002 peak in XRD?
The 002 peak comes from the second-order reflection of the planes stacked along the c axis. In hexagonal and layered materials, those planes are spaced c ÷ 2 apart, so the (002) peak gives the c lattice parameter directly. For zinc oxide, d = 5.207 ÷ 2 = 2.6035 Å, which puts (002) at 34.42° 2θ with Cu Kα1.
A strong (002) peak often means the crystals lie with their c axis pointing the same way, called a preferred orientation. Layered materials and many thin films show this.
Which software is used for XRD analysis?
Common options include HighScore from Malvern Panalytical, JADE, the free GSAS-II from Argonne National Laboratory and FullProf. They fit peaks, match patterns against reference databases and refine crystal structures.
For quick checks of single peaks, the Bragg’s law calculator is often faster. It gives d, 2θ, order limits and crystallite size without loading a full pattern, and it runs in a phone browser much like an app.
What is the general formula for wavelength and frequency?
For any wave, the wavelength equals its speed divided by its frequency, λ = v ÷ f. For X-rays and light the speed is c, so f = c ÷ λ, and the photon energy is E = hf = hc ÷ λ. The wavelength calculator and frequency calculator handle these conversions for any wave.
Diffraction from a lens or aperture follows a related rule, set by the wavelength and the aperture size, as the angular resolution calculator shows. More tools sit on the optics calculators hub.