Bragg's Law Calculator

Solve Bragg's law n lambda = 2d sin theta for any variable. Converts 2 theta peak positions to d-spacings, lists every diffraction order, and computes d from lattice parameters.

https://hexacalculator.com/calculators/physics/modern-physics/braggs-law-calculator

Physics

Modern Physics

Bragg's Law Calculator

Solve Bragg's law n lambda = 2d sin theta for any variable. Converts 2 theta peak positions to d-spacings, lists every diffraction order, and computes d from lattice parameters.

Bragg's Law Calculator

Wavelength, spacing and angle

My angle is the detector angle 2 theta

Diffractometers report 2 theta. Bragg's law needs theta, which is half of it. Leave this off if you already halved the peak position.

Fill in any two of the wavelength, the spacing and the angle. The calculator solves for the one you leave blank.

Propagate an angle uncertainty

Turns a peak-position error bar into an error bar on the d-spacing.

Work d out from lattice parameters and Miller indices

A reference calculation: the spacing of the (hkl) planes for a unit cell you already know.

Diffraction analysis

Show every diffraction order

Each order n that fits inside the 2d limit, and the angle it appears at.

Show the d-spacing conversion curve

The peak-position to d-spacing curve for the wavelength you are using.

Compare the standard X-ray sources

Where this reflection would land on eight common laboratory and synchrotron wavelengths.

Loading calculator…

The Bragg's law converts a single peak in a diffraction pattern to the spacing within a crystal.

If you enter two of the three values - wavelength, grating spacing or angle - this calculator will calculate the remaining value. It also shows the detection angle, photon energy and scattering vector as well as all higher diffraction orders that are geometrically possible.

The importance of Bragg's law:

X-rays hitting a crystal are not perceived as a dense mass. Instead they see several layers of atoms lying on top of each other at regular intervals, with each layer acting like a weak half-mirror.

The wave reflected from the second layer travels a longer path than the wave reflected from the first layer. If this additional path length is exactly an integer multiple of a wavelength, then both reflected waves return in phase and reinforce each other.

In all other directions the waves cancel each other out. So a crystal is dark in almost all directions, with only a few unusual bright directions. The position of these bright directions can be used to directly measure the spacing between the layers.

Bragg's law

Geometric relations show that the additional path length is twice the product of the distance between the surfaces and the sine of the angle of incidence. If this equals an integer multiple of the wavelength, then we obtain the following condition:

nλ=2dsinθn\,\lambda = 2\,d\,\sin\theta

These four dimensions have the following meaning:

Symbol

Name

What it is

n

Order of reflection

A positive whole number: how many wavelengths fit into the extra path

lambda

Wavelength

The radiation used, typically 0.5 to 2.5 angstroms for X-rays

d

Interplanar spacing

The perpendicular distance between neighbouring planes of atoms

theta

Bragg angle

Measured from the PLANE, not from the normal to it

The last line can be confusing. In optics the angle of incidence is usually measured from the normal to the surface. By contrast, for diffraction the angles are measured from the crystal lattice itself, which leads to the sine in this equation, while the refraction equation contains cosine.

The formula is extended with the missing size:

θ=arcsin ⁣(nλ2d)d=nλ2sinθλ=2dsinθn\theta = \arcsin\!\left(\frac{n\lambda}{2d}\right) \qquad d = \frac{n\lambda}{2\sin\theta} \qquad \lambda = \frac{2 d \sin\theta}{n}

Theta and two theta? This error halves the result.

A powder diffractometer scans the angle between the incident and exiting beams with a detector. This angle is called 2 theta and is the value given for all peak positions, ICDD cards and plotted patterns.

For the Bragg's law we need the angle theta, so half of that. If you put directly in the formula the original peak value of 28.44, it gives a layer distance of 1.618 angstroms which is not the correct one for silicon (111), which is 3.135.

The switch above the angle slit performs this conversion. If the peak position has already been halved, then this switch should be turned off. If the device directly displays the values output by the measuring instrument, then the switch should be turned on.

A full example:

Let's consider an x-ray with a wavelength of 1.20 angstroms and a crystal with a layer spacing of 2.80 angstroms.

This is true for the first order, n = 1.

sinθ=nλ2d=1×1.202×2.80=0.214286\sin\theta = \frac{n\lambda}{2d} = \frac{1 \times 1.20}{2 \times 2.80} = 0.214286
θ=arcsin(0.214286)=12.3742θ=24.748\theta = \arcsin(0.214286) = 12.374^\circ \qquad 2\theta = 24.748^\circ

As long as the value resulting from multiplying the wavelength by n is less than twice the interplanar spacing, diffraction will occur at higher orders for the same set of crystal planes.

Order n

sin(theta)

theta

2 theta

1

0.214286

12.374 deg

24.748 deg

2

0.428571

25.377 deg

50.754 deg

3

0.642857

40.005 deg

80.011 deg

4

0.857143

58.997 deg

117.995 deg

5

1.071429

no solution

no solution

The upper limit is given by the value that results when 2d is divided by the wavelength, which here is 4.667. So there are four orders but no fifth order. The calculation tool reports this upper limit as the highest order that satisfies the condition.

The reason for this limitation is as follows.

Since sin(θ) can never be greater than 1, solutions to the Bragg condition only exist when:

nλ2dn\lambda \le 2d

When n=1 this is the resolution limit; no radiation can resolve crystal planes separated by less than half its own wavelength.

dmin=λ2d_{\min} = \frac{\lambda}{2}

Thus the Cu K-alpha1 at 1.54056 angstroms therefore reaches down to 0.77 angstroms. This is significantly less than any interatomic spacing in normal solids, which is why copper tubes are a standard lab tool. Visible light with wavelengths of several thousand angstroms cannot come close to this task, and the difference is many thousands of times.

Wavelength and photon energy

Beamline operators communicate in kilo-electron volts (keV) while X-ray tube manufacturers give information in angstroms. The Planck relation provides the connection between these two units.

E [keV]=12.39842λ [A˚]E\ [\mathrm{keV}] = \frac{12.39842}{\lambda\ [\text{\AA}]}

This constant is the product of Planck's constant and the speed of light, both of which are precisely defined by the SI system, and expressed in units actually used for crystallography.

Source

Wavelength (angstrom)

Photon energy (keV)

Cr K-alpha1

2.28970

5.415

Fe K-alpha1

1.93604

6.404

Co K-alpha1

1.78897

6.931

Cu K-alpha1

1.54056

8.048

Cu K-alpha weighted

1.54184

8.041

Mo K-alpha1

0.70930

17.481

Ag K-alpha1

0.55941

22.163

Synchrotron, tunable

1.00000

12.398

In some data tables the decimal places may differ slightly. Some lists give the K-alpha1 line while others use a weighted average of the K-alpha1 and K-alpha2 lines. In most cases this difference is not relevant, but it cannot be ignored when determining more accurate lattice constants. So you should check which values are given in the reference material used.

There are trade-offs in choosing a light source. A longer wavelength leads to broader patterns and improves angular resolution but reduces the number of reflections that can be reached. A shorter wavelength increases penetration depth and allows more reflections, but compresses the overall pattern into a very small angular range. For samples containing iron, cobalt or iron lines are preferred because copper X-rays would excite fluorescence from iron which could lead to increased background signal in the detector.

The d-distances can be read off of the pattern.

The most common use of the Bragg law is the opposite: you have a peak position, know the wavelength and want to determine the spacing between planes in order to match it with a database.

For the copper K-alpha1 radiation and a single reflection, the known peak positions for known materials are as follows:

Material

Plane (hkl)

d (angstrom)

2 theta with Cu Kalpha1

Silicon

(111)

3.135

28.44 deg

Silicon

(220)

1.920

47.30 deg

Quartz

(101)

3.343

26.64 deg

Calcite

(104)

3.035

29.40 deg

Anatase TiO2

(101)

3.520

25.28 deg

Rutile TiO2

(110)

3.248

27.44 deg

Halite NaCl

(200)

2.821

31.69 deg

Aluminium

(111)

2.338

38.47 deg

Copper

(111)

2.088

43.30 deg

Gold

(111)

2.355

38.18 deg

A single matching spacing is not enough to prove anything. It's not uncommon for different phases to have the same interplanar spacing so at least three strongest peaks must match and ideally the relative intensities should also match to give a unique identification.

Calculation of the d-distance from the elementary cell:

If the unit cell is already known then the spacing for any (hkl) plane can be directly calculated. An optional lattice window allows calculations for four crystal structures.

cubic:d=ah2+k2+l2\text{cubic:}\qquad d = \frac{a}{\sqrt{h^2 + k^2 + l^2}}
tetragonal:1d2=h2+k2a2+l2c2\text{tetragonal:}\qquad \frac{1}{d^2} = \frac{h^2 + k^2}{a^2} + \frac{l^2}{c^2}
hexagonal:1d2=43h2+hk+k2a2+l2c2\text{hexagonal:}\qquad \frac{1}{d^2} = \frac{4}{3}\cdot\frac{h^2 + hk + k^2}{a^2} + \frac{l^2}{c^2}
orthorhombic:1d2=h2a2+k2b2+l2c2\text{orthorhombic:}\qquad \frac{1}{d^2} = \frac{h^2}{a^2} + \frac{k^2}{b^2} + \frac{l^2}{c^2}

Silicon has a cubic crystal structure with a = 5.4309 angstroms, so the spacing for (111) is:

d111=5.4309 A˚12+12+12=3.1355 A˚d_{111} = \frac{5.4309\ \text{\AA}}{\sqrt{1^2 + 1^2 + 1^2}} = 3.1355\ \text{\AA}

If you use the X-ray radiation of copper and put it into Bragg's law, a peak position at 28.44 degrees (2 Theta) results, which exactly matches the angle indicated by a silicon standard sample.

Where is order?

When Bragg wrote his law he explicitly stated the order but in modern practice almost always n = 1 is assumed with the order implicit in the Miller indices.

The reason for this is an identity: The secondary reflection from a plane with the index (111) has exactly the same angle as the primary reflection from a plane with half the distance. These planes are called (222). Since the spacing (222) is already in the list of spacings, the peak is indexed there and n vanishes.

If you need a database query, leave n at 1. If for educational purposes or planning reasons you want to examine certain higher order families of levels, increase n.

How accurate is distance measurement?

By taking the derivative with respect to angle, one can determine the error that is introduced by inaccuracies in peak position.

σd=dcotθ  σθ\sigma_d = d\,\cot\theta\;\sigma_\theta

The cotangent function is particularly interesting. The cotangent diverges near zero degrees and approaches zero near 90 degrees. So the same error in peak position at low angles leads to a much larger error than at high angles.

This fact dictates the care required for diffraction experiments. In precise measurements of lattice parameters back reflection peaks beyond about 120 degrees (2 theta) are used. These peaks are broad and may be split by the K-alpha doublet, but the geometric relationships themselves reduce error.

Note that sigma theta must be given in radians. The uncertainty panel will do this conversion. If you use 2 theta, first halve the input value.

Systematic errors to be considered:

One of the most common sources of error is zero point drift. If it is determined that the goniometer has not been calibrated to an actual zero, all peaks will be shifted by the same amount and all distances will be calculated incorrectly accordingly. This problem can be corrected by measuring standard samples such as silicon or lanthanum hexaboride and then refining the shift amount.

The sample shift also has similar effects. When the sample is only a few millimeters above or below focus, the peaks show an angular shift. This is one of the biggest sources of error in regular powder measurements.

At high angles the Kα1 and Kα2 lines are clearly separated because of slightly different angles. The analysis software usually removes the contribution from Kα2 before a fit is performed.

Beyond X-rays.

None of the derivation steps are specific to light; any kind of wave can be used as long as its wavelength is roughly on the order of an atomic spacing.

Electrons follow the de Broglie relation as waves. At 200 keV, their wavelength is about 0.0251 angstroms, which is about one-sixtieth of the wavelength of copper X-rays. This extremely short wavelength means that each Bragg angle is compressed to less than a degree. Therefore, electron diffraction patterns in transmission electron microscopes appear more like a flat grid of dots rather than broad rings.

Neutrons are in between; the wavelength of thermal neutrons is about 1 to 2 angstroms. Since neutrons interact with atomic nuclei and not with the electron cloud, even light atoms such as hydrogen that are barely visible by X-rays can be detected. In addition they allow visualization of magnetic orderings due to their magnetic moment.

Areas of application for this rule:

Identification of substances:

By converting the peak positions into distances and comparing with datasets from the Powder Diffraction File or the Crystallography Open Database one can determine what substance it is. This is the most common application of X-ray analysis in materials science.

Lattice constants and deformation:

By precisely determining the unit cells of the entire pattern, thermal expansion can be tracked, residual stresses in welds measured or the expansion of battery electrodes during charging observed.

Structural biology.

Photo 51 by Rosalind Franklin showed a diffraction pattern of fibers which was interpreted using Bragg's law. Protein crystallography is still based on these principles but now uses synchrotron radiation and detectors that can capture millions of reflections.

Thin films and multilayer structures

Artificial layer structures have their own periodicity, where this period is much larger than the atomic spacing, leading to diffraction at very small angles. The thickness of the layers can be determined from the same equation.

Common Mistakes

The use of "2θ" instead of "θ" where θ should be used is the most common error and occurs many times more often than any other. It is hard to spot, and although the result looks plausible it is actually about twice as wrong.

Another common mistake is the confusion of units for wavelength and distance. Using angstroms vs nanometers leads to a tenfold difference, but this error is often unnoticed because it cancels out in the ratio in the equation. The conversion here plays the role of correction.

The third error is not in the crystal surface itself but in measuring the angle from the normal of the crystal surface. This creates a complementary angle so that 12 degrees equals 78 and the final calculated distance becomes much smaller.

After all, the Bragg law only gives possible positions where peaks can occur but never their intensity. The intensity depends on structure factors which set many geometrically allowed reflections to zero by structure factors. A typical example is the extinction of reflections in cubic metals with a body-centered lattice (100).

Frequently asked questions

What is Bragg's Law?

It describes the conditions under which reflected waves from neighboring atomic planes within a crystal experience constructive interference. The value n times wavelength is equal to 2d sine theta. When the extra distance between neighboring crystal faces is an integer multiple of the wavelength, then the reflected waves add together and there's a diffraction peak.

Do I enter theta or 2 theta?

For the Bragg's law we use theta, which is the angle between the ray and the atomic plane. However a diffractometer reports 2 theta, which is the angle between the incident and emergent rays. Enable the option for the detector angle and enter directly the peak position. If it has already been halved leave the option disabled.

How do you calculate the distance d of a peak position?

To calculate the value of theta, divide the given value by two and then find the angle. The wavelength is then divided by twice the sine of this angle. If left blank, a calculator will automatically perform these calculations. Using copper K-alpha1 radiation gives a peak position of 28.44 degrees (equivalent to an angle of 2 theta) with an interplanar spacing of 3.1357 angstroms, which indicates silicon (111).

Why does the calculator sometimes show no solution?

Since sin(θ) cannot be greater than 1, there is a solution to this equation only if the product of the wavelength and n is less than or equal to twice the grating spacing. If the wavelength is longer than 2d, then at no observed angle will there be reflection. This also explains why spacings shorter than half the wavelength cannot be resolved.

What degree of n should be used?

When comparing with a reference database, use 1. Higher orders of a particular Miller index lead to reflections at the same angle as single reflection from planes with proportionally smaller spacing. In modern practice, the order is incorporated into the Miller indices and always given as n = 1.

Does the Bragg law also apply to electrons and neutrons?

The following is true: For diffraction only waves and a periodic array are needed. The wavelength of electrons at 200 kilovolts is about 0.0251 angstroms, so every Bragg's angle is less than one degree. Thermal neutrons have wavelengths in the range of about 1 to 2 angstroms, which is close to values used for X-rays in laboratories.

Related calculators

Disclaimer: This calculator is provided for general informational and educational purposes only. Our calculators are under active development, and results may be inaccurate, incomplete, or unsuitable for your situation. Always verify the figures independently and seek advice from a qualified professional before relying on them. We make no warranties and accept no liability for any loss or decision arising from use of this tool.

References

  1. Bragg, W. H. and Bragg, W. L. (1913). The Reflection of X-rays by Crystals. Proceedings of the Royal Society A 88, 428-438

    The original paper that states the diffraction condition.

  2. International Union of Crystallography: Online Dictionary of Crystallography, Bragg's law

    The discipline's own definition, including the theta versus 2 theta convention.

  3. NIST X-ray Transition Energies Database

    Measured K-alpha and L-alpha line energies and wavelengths for the standard anode materials.

  4. Crystallography Open Database

    Open-access crystal structures, the free route to reference d-spacings for phase matching.

  5. Wikipedia: Bragg's law

    Derivation, the relationship to the Laue conditions, and the history of the 1915 Nobel Prize.

  6. HyperPhysics (Georgia State University): Bragg's law

    A short geometric derivation of the path-difference argument.