Home / Science / Materials science / Crystallography / XRD peak calculatorTool #842

XRD calculator: Bragg's law, Scherrer crystallite size, Williamson-Hall plot and cubic peak indexing

Turn powder X-ray diffraction peaks into d-spacings, crystallite sizes (Scherrer, with the instrument's width taken away), size and microstrain from a Williamson-Hall plot, and a cubic lattice (simple, body-centred, face-centred or diamond) with its lattice parameter. Type peaks or open a 2θ scan and let the page find and fit them.

Keep it one tap away for everyday use.

Bookmark XRD peak calculator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Scan
  2. Peaks
  3. d and size
  4. Lattice
Nothing is uploadedWorks offline once open

Wavelength and settings

The wavelengths are rounded standard values; type your own if your instrument's report gives one. K is about 0.9 for round crystallites (0.94 for cubes; use 1 with integral breadths). The instrument width is the FWHM a strain-free, large-grain standard gives on your machine. Gaussian peaks lose it in quadrature (β² = B² − b²), Lorentzian ones straight (β = B − b).

Bragg's law

nλ = 2d sin θ. Type 2θ to get d, or d to get 2θ.

Scan (optional)

Two columns: 2θ in degrees, then counts (XY, CSV or text exports; a header row is fine). Find peaks fits each peak with the shape above plus a straight line and puts the positions and widths into the peak list, where you can delete or change rows. Strip Kα2 first, or fit with a Kα1-only source, for the best widths.

Peak list

What it does

A powder X-ray diffraction pattern is a list of peaks: each sits at an angle 2θ set by the spacing d between planes of atoms, and each has a width that grows as the crystallites get smaller or more strained. This page does the everyday sums on those peaks in one place:

  • Bragg’s law. nλ = 2d sin θ turns every 2θ into a d-spacing, for Cu, Co, Fe, Cr, Mo or Ag Kα lines or any wavelength you type. A small box converts one 2θ to d and back.
  • Scherrer size. D = Kλ / (β cos θ), where β is the peak’s own breadth in radians after the instrument’s width is taken away: in quadrature for Gaussian peaks (β² = B² − b²) or straight for Lorentzian ones (β = B − b).
  • Williamson-Hall plot. With three or more widths, β cos θ is plotted against 4 sin θ. A straight line through the points has intercept Kλ/D (size) and slope ε (microstrain), so size and strain are separated. Standard errors and R² are shown.
  • Cubic indexing. The ratios of 1/d² (or sin²θ) between lines are whole-number ratios of h² + k² + l². The page tries simple cubic, body-centred, face-centred and diamond cubic, assigns hkl to every line, works out the lattice parameter a from all indexed lines, and lists allowed lines that should be there but are not.
  • Peak picking. Open a 2θ/intensity scan (XY, CSV, TXT or Excel). The page takes away a smooth background, finds the peaks, and fits each with a Gaussian or Lorentzian plus a straight line to get its position and FWHM.

How to use it

  1. Wavelength. Pick the X-ray source or type λ. Set K (0.9 is usual) and your instrument’s width: the FWHM a large-grain, strain-free standard such as a line-profile standard gives on the same machine and settings.
  2. Scan or peaks. Open a scan and press Find peaks, or type peaks straight into the list: 2θ, then FWHM if you have it, then intensity. Delete rows you do not want, such as Kα2 shoulders or impurity peaks.
  3. Read the results. The table gives d, the sample breadth, the Scherrer size, hkl and a for each peak. The cubic table ranks the four lattices. The Williamson-Hall plot shows how well size and strain explain the widths.
  4. Download the peak table as CSV, or a PNG, PDF or Word report.

Worked example

Press Use the example scan. It is a made-up Cu Kα1 pattern (λ = 1.5406 Å) of a face-centred cubic metal with a = 4.000 Å, 25 nm crystallites and 0.2 % strain, measured on an instrument with a 0.06° width.

Find peaks returns six peaks, at 2θ = 38.969, 45.306, 66.007, 79.387, 83.694 and 100.756°. Their ratios of 1/d² are 3 : 4 : 8 : 11 : 12 : 16, so the page reports face-centred cubic, a = 4.0000 Å, with hkl 111, 200, 220, 311, 222 and 400 and no allowed lines missing. Simple cubic indexes the same lines only by leaving out 100, 110, 210 and more; diamond cubic cannot index 200 or 222.

The Scherrer sizes fall from 16.8 nm at 111 to 11.4 nm at 400. That steady fall is the sign of strain: Scherrer puts all the broadening down to size. The Williamson-Hall fit separates the two and gives 26.1 nm and 0.21 % strain (R² = 0.986), close to the 25 nm and 0.2 % the scan was made with; the weak 400 peak carries the most noise.

Tips

  • Widths need care. Use a Kα1-only source or strip Kα2 first, and measure the instrument width on a standard under the same slits.
  • A Scherrer size above about 100 to 200 nm is not reliable: the sample breadth becomes too small next to the instrument’s.
  • Indexing assumes a cubic phase. If no lattice indexes every line, the sample may be another crystal system, a mixture, or the list may hold Kα2 or Kβ peaks. Use the Miller index calculator for other systems.
  • Simple cubic and body-centred cubic give identical patterns up to the sixth line. A seventh line, at seven times the first 1/d², settles it.

FAQ

Which width should I use: FWHM or integral breadth? The page uses whatever width you give. With FWHM, K is about 0.9; with integral breadth (area ÷ height), use K close to 1.

Why is the Williamson-Hall size different from the Scherrer size? Scherrer assumes there is no strain, so strain broadening makes the crystallites look smaller. Williamson-Hall separates the two, but it assumes the size and strain broadenings simply add.

Is my scan uploaded? No. The file is read and fitted on this page, and nothing is sent anywhere.

Where the numbers come from

  • Bragg's law, the Scherrer equation, the Williamson-Hall method and the cubic selection rules are standard textbook physics; the code is written by fibub and checked in the tests against NumPy and SciPy (find_peaks, curve_fit, polyfit).
  • Anode wavelengths are rounded general constants (for example Cu Kα1 1.5406 Å) and can be edited.
  • The example scan is made up by the page: a face-centred cubic metal with a = 4.000 Å, 25 nm crystallites and 0.2 % strain, with made-up intensities and noise.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Crystal field and spin state calculator #93 Pick a d-block metal ion and a geometry (octahedral, tetrahedral, square planar, square pyramidal), give Δ and the pairing energy or an absorption band, and get the d-orbital diagram, high or low spin, CFSE, unpaired electrons, spin-only moment and the Jahn–Teller tendency. Molecular point group finder #110 Paste a molecule's XYZ coordinates or open an .xyz file to get its point group (C₂ᵥ, D₃h, T_d, O_h, I_h and the rest), every symmetry element, the group order, and whether the molecule can be chiral or polar. No coordinates? Answer the flowchart questions instead. 23 example molecules. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser. CIF viewer #843 Open a Crystallographic Information File (CIF) and see the unit cell in 3D: the symmetry operations fill the cell from the listed atoms, and the page gives bond lengths and coordination, the cell volume, the formula and formula units Z, and the density. The file never leaves your browser. Miller index calculator #844 Work out the spacing of any (hkl) plane in cubic, tetragonal, orthorhombic, hexagonal, trigonal, monoclinic or triclinic cells, the angle between two planes, their zone axis and the 2θ of each, convert to and from four-index Miller-Bravais notation, list reflections, and see the planes drawn in the unit cell. Electron diffraction indexer #845 Index TEM and SAED patterns in the browser: the relativistic electron wavelength and camera constant λL, calibration with rings of a known standard, d-spacings from ring radii or spot distances, ring-ratio indexing of cubic lattices with the lattice parameter, and the zone axis of a two-spot pattern.