Miller & Bragg

Draw the section of an (hkl) plane inside a unit cell, practise indexing step by step, generate matching exercises, explore tetragonal, orthorhombic and hexagonal cells, or simulate powder and single-crystal X-ray diffraction. New to Miller indices? Start with Single plane, then practise in Step by step.

cubic cell · a = b = c · intercepts in units of a
Drag to rotate. Arrow keys work when the drawing is focused.
Atoms on the plane
Compare
Equivalent planes

Miller indices
( )
Also draw
Direction [uvw]
[ ]
Plane spacing

Manual

About

Miller & Bragg is an interactive tool for teaching Miller indices and X-ray diffraction, from lattice planes to the peaks of a powder pattern and the spots of a single crystal. It is named after William Hallowes Miller, who introduced the indices in 1839, and William Henry and William Lawrence Bragg, whose work of 1912–13 gave Bragg's law, the link between the planes and the diffraction peaks. It draws the section of any lattice plane inside a unit cell, takes students through the indexing procedure one step at a time, generates matching exercises with targeted feedback, and connects planes to diffraction, planar density, slip and non-cubic cells.

It is written for undergraduate and taught postgraduate courses in chemistry, materials science, physics and engineering. Lecturers can use it live in lectures, set it for self-study, or copy its figures into quizzes and slides.

The whole tool is a single HTML file. It needs no installation or account, uses your computer's own fonts, works offline, and sends nothing anywhere. The one exception is the optional Feedback form: an anonymous Microsoft Form that loads from Microsoft only when you press Feedback. It remembers only two preferences in your browser: whether you have seen the tour, and whether Single plane shows all its cards.

Quick start

New to Miller indices? Start with Single plane, then practise in Step by step. The Tour button at the top walks you through the whole app in about seven minutes, or through just the tab you have open. Choose a mode from the tabs at the top of the page.

TabUse it to
Single planeDraw any (hkl) plane in a cubic cell, see the full working, and explore families, equivalent planes, atoms, directions and diffraction.
Step by stepPractise indexing a random plane in three checked steps, with hints and feedback on each step.
Matching setGenerate six random planes labelled A to F and match or type their indices, with distractors, hints and an answer key.
X-ray diffractionShine X-rays on a cubic crystal at an adjustable angle and see how Bragg's law, the planes and the atoms produce, or cancel, the peaks of a simulated powder pattern.
Peaks to planesIndex the powder pattern of an unknown cubic crystal: sin²θ, ratios, N, Miller indices, lattice type and cell edge, in a worksheet that checks each column.
Single crystalTurn a single crystal in the X-ray beam and watch reflections appear on a detector and on the Ewald sphere, or collect a rotation photograph.
Non-cubic cellsIndex planes in tetragonal, orthorhombic and hexagonal cells, including Miller–Bravais (hkil) indices.

Every drawing can be rotated by dragging it. Reset view returns to the standard orientation, and Copy figure… produces a clean black-on-white image for a quiz or slide.

Glossary

Unit cellA box that builds the whole crystal when stacked in three directions; its edges are a, b and c. The conventional cells used here are chosen to show the symmetry, so they can hold more than one lattice point: two in a body-centred cell, four in a face-centred one. The smallest possible cell, with one lattice point, is the primitive cell.
Miller indices (h k l)Three whole numbers that name a set of parallel planes: the reciprocals of where a plane cuts the three axes, in units of the cell edges.
InterceptThe point where a plane cuts an axis, measured from the origin as a fraction of the cell edge. A plane parallel to an axis never cuts it: its intercept is ∞ and its index is 0.
Origin O′The corner of the cell chosen as the new origin, so that the intercepts can be read inside the cell. A plane that cuts an axis on its negative side has a negative index; moving the origin does not change the indices, it only makes that intercept readable inside the cell.
Bar notationA negative index written with a bar over the number: (1 2 3) means h = 1, k = −2, l = 3.
Family of planesThe parallel, equally spaced planes hx + ky + lz = n, for every whole number n (x, y, z as fractions of the cell edges). Every plane of the family has the same Miller indices (h k l), and neighbours are d apart. (2 0 0) and (1 0 0) are parallel but different families: (2 0 0) also includes the planes halfway between those of (1 0 0).
d-spacing, dThe distance between neighbouring planes of a family. For a cubic cell, d = a/√(h² + k² + l²).
Form {h k l}All the families of planes that symmetry makes identical; in a cube, {1 0 0} includes (1 0 0), (0 1 0), (0 0 1) and their negatives.
MultiplicityThe number of reflections (h k l) in a form, counting (h k l) and (−h −k −l) separately although they describe the same planes: {1 0 0} has multiplicity 6. In a powder pattern they all give the same peak, so a high multiplicity makes a peak stronger.
Direction [u v w]A direction in the crystal, written in square brackets. ⟨u v w⟩ is the set of equivalent directions.
Zone axisThe direction shared by a set of planes (a zone): the line parallel to all of them. A direction [u v w] lies in the plane (h k l), so (h k l) belongs to the zone with axis [u v w], when hu + kv + lw = 0.
Miller–Bravais indices (h k i l)Four indices for hexagonal crystals, with i = −(h + k), so that equivalent planes have similar-looking indices.
Bragg's lawnλ = 2d sin θ. X-rays reflect strongly from a family of planes when the extra path between neighbouring planes, 2d sin θ, is a whole number n of wavelengths.
θ and 2θθ is the angle between the X-rays and the planes; 2θ is the angle between the incoming and diffracted beams, which is what a diffractometer records.
ReflectionThe diffracted beam, or the powder-pattern peak, from one family of planes. It is labelled with the plane's indices.
Order nThe whole number in Bragg's law. The second-order reflection from (1 0 0) is written as (2 0 0).
Structure factor FThe combined wave scattered by all the atoms in the unit cell for one reflection. The peak intensity is proportional to |F|².
Systematic absenceA reflection with F = 0 because of the lattice centring or a symmetry element such as a glide plane or screw axis: atoms between the planes scatter exactly out of step with those on them, so no peak appears even though Bragg's law is met. Body- and face-centred absences come from centring; diamond's missing (2 0 0) comes from its glide planes. A reflection that is weak only by accident of the atom positions, such as rock salt (1 1 1), is not a systematic absence.
Planar densityThe number of atoms per unit area of a plane. Metals slip most easily along their densest planes.
Reciprocal latticeA lattice of points, one for each family of planes (h k l), placed 1/d from the origin in the direction normal to the planes.
Ewald sphereA sphere of radius 1/λ drawn in reciprocal space. A reflection occurs when a reciprocal lattice point lies on it; this is Bragg's law in three dimensions.
Rotation photographThe pattern recorded while a single crystal turns about one axis: every spot that flashes up is kept, and the spots fall on layer lines.
Mosaic spreadThe small misalignment of the blocks that make up a real crystal, typically a few tenths of a degree. It lets a reflection appear over a small range of angles.
Crystallite sizeThe size of a single crystal grain in a powder. Small crystallites have few planes, so their peaks are broad.

Conventions

The tool applies one set of conventions everywhere, so the drawings, feedback and answer keys always agree.

Axes and cell

The cubic cell has edge a. The x axis points towards the viewer, y to the right and z upwards, all starting at the cell origin (0, 0, 0). In non-cubic cells the axes are labelled a, b and c, or a₁, a₂, a₃ and c for hexagonal cells.

Origin shift

For each negative index, the origin moves one cell edge along that axis to a new origin O′. Intercepts are then read from O′ as fractions of the cell edge, and travelling against an axis arrow gives a negative intercept. Formally, the drawn plane is h(x − x₀) + k(y − y₀) + l(z − z₀) = 1, where (x₀, y₀, z₀) is O′.

Indices are not reduced

The indices are the reciprocals of the intercepts, kept as they are. (0 0 2) cuts z at ½ and is a different set of planes from (0 0 1), which cuts z at 1. This matches the Laue indices used in diffraction, where (0 0 2) is the second-order reflection from the (0 0 1) planes.

Notation

(h k l)one plane or set of parallel planes
{h k l}a form: all planes equivalent by symmetry
[u v w]one direction
⟨u v w⟩a family of equivalent directions
(h k i l)Miller–Bravais indices of a hexagonal plane, with i = −(h + k)

Negative indices are shown with a bar, as in (1 2 3), and are typed with a minus sign, as in (1 −2 3).

Planes through the cell centre

When |h| + |k| + |l| = 2, as for (0 0 2), (1 1 0) or (1 −1 0), the drawn plane passes through the centre of the cell, and the negated indices draw exactly the same section. The tool flags this in the working, never offers both of such a pair in one matching set, and accepts either answer when indices are typed.

Single plane

Entering indices

Type h, k and l (whole numbers from −9 to 9) or pick a preset. The drawing, working and every card update as you type. While an entry is unfinished or invalid, the drawing and working are greyed out.

The tab opens with just the drawing, the indices and the working. Show more adds the cards for atoms, directions, plane spacing and equivalent planes; the browser remembers your choice.

Origin shift and intercepts

With Show origin shift and intercepts ticked, the drawing marks O′ in orange, with short arrows along the axis directions, and dashed lines from O′ to each intercept, labelled with its fraction. The Working card lists the same three steps in words, with a table of intercepts and reciprocals.

Also draw

  • Parallel family and d draws every member of the family that cuts the cell, and a double arrow marked d between the drawn plane and its neighbour.
  • Equivalent planes {hkl} draws all symmetry-equivalent planes. The Equivalent planes card lists the members with the multiplicity; pointing at a member outlines it in the drawing, and clicking it makes it the current plane.

Atoms on the plane

Choose simple cubic, BCC, FCC, rock salt (NaCl), caesium chloride (CsCl) or diamond. Atoms are coloured by their position relative to the (hkl) planes:

Goldon the drawn plane
Tealon another plane of the same family, so scattering in phase
Redexactly halfway between two planes, so scattering in antiphase
Greypart of the way between planes, for example the quarter positions in diamond

In rock salt and CsCl, spheres with a dark centre are the cations (Na⁺ or Cs⁺) and plain spheres are Cl⁻. The card states whether the (hkl) reflection is allowed, weak or systematically absent and explains why, using the red atoms. It also gives the planar density on the drawn plane, in atoms per a² and per nm² (using the cell edge from the Plane spacing card), and compares {1 0 0}, {1 1 0} and {1 1 1} with a note on slip systems. The Compare buttons switch on FCC and the parallel family and load a plane, which makes it quick to step from (1 0 0), which is absent, to (2 0 0), which is allowed. With diamond selected, (2 0 0) and (2 2 2) show how the second set of atoms removes reflections that FCC allows.

Direction [uvw]

Tick Draw a direction to add a blue arrow. By default it uses the plane's own indices, which shows that [h k l] is perpendicular to (h k l) in a cubic cell. Untick Use the plane's indices to enter any [u v w]. The arrow starts at the conventional origin for that direction, and a dashed copy passes through the plane so the angle is visible. The card evaluates hu + kv + lw: zero means the direction lies in the plane (the zone law); otherwise it gives the angle to the plane normal.

Plane spacing

The card gives d = a/√(h² + k² + l²), and with a cell edge and wavelength (default Cu Kα₁, 1.5406 Å) the Bragg angle 2θ. If a structure is selected and the reflection is absent, this is marked next to 2θ. For indices with a common factor n, the card explains that the reflection is the nth order of the reduced planes.

Step by step

The tool draws a random plane, with indices up to ±1, ±2 or ±3, and students solve it in three checked steps. Each step opens only after the previous one is correct.

  1. Choose the new origin O′. Click a corner of the drawing or pick its coordinates from the list. A corner is accepted when the plane cuts every edge leaving it at 1/h, 1/k and 1/l, or, for a plane through the centre of the cell, at −1/h, −1/k and −1/l. A corner that lies on the plane, from which an edge misses the plane, or from which the intercepts are not of that form (such as −2/3 for (3 0 0) seen from x = 1), gets an explanation.
  2. Read the intercepts. Type each as a fraction (1/2, −1/3), a whole number, or inf for ∞. Each wrong axis gets its own feedback: a wrong sign, the reciprocal entered too early, a position measured from the original origin instead of O′, or 0 where the plane runs parallel to the axis.
  3. Take reciprocals. Type h, k and l. Feedback names the likely mistake: one or more signs flipped, all signs reversed, two indices swapped, indices reduced by a common factor, or a zero in the wrong place.

Each step offers two hints before Show me. In step 1 the second hint gives one or two coordinates of O′; in step 2 it marks the cut points on the drawing without their values; in step 3 it works out the first index. The tally counts planes solved and steps right first time without hints. Nothing is stored after the page is closed.

Directions

Switch Practise to Directions [u v w] to index arrows instead of planes. At ±1 the arrows join corners of the cell; from ±2 they can also start or end at edge midpoints, face centres and the body centre. Students work in three checked steps:

  1. Read the tail, the open circle where the arrow starts, as fractions of the cell edge (0, 1/2 or 1).
  2. Read the head, the arrow tip, in the same way. Entering the head for the tail, or the other way round, is recognised and explained.
  3. Subtract and clear fractions: head − tail, multiplied through and reduced to the smallest whole numbers. Once the coordinates are right, a dashed path on the drawing shows Δx, Δy and Δz. Feedback recognises a reversed direction (tail − head), indices that are not the smallest whole numbers, the head's coordinates used on their own, swapped indices and sign errors.

The finishing note points out the contrast with planes: directions are always reduced, so [2 2 0] is the same direction as [1 1 0], whereas (2 2 0) and (1 1 0) are different sets of planes.

Matching set

Generating a set

Choose the index range and press New set. Each set has a set number. The same set number, index range and distractor setting always produce the same six planes, so a lecturer can put a set number on screen and every student sees the same exercise. The six planes are always geometrically distinct, and planes that would be seen almost edge-on in the standard view are never chosen. Reveal answers asks for a second click, so answers are not shown by accident.

Answer format

  • Choose from a list gives each card a dropdown, as in a typical online quiz. With Add 2 distractors built from common mistakes ticked, the list contains two extra answers made from errors on the drawn planes: one sign flipped, two indices swapped, indices reduced, or all signs reversed.
  • Type the indices asks for free text, which prevents answering the last cards by elimination. Accepted forms include 2 3 -1, (2,3,−1), [2 3 -1] and the compact 23-1.

Hints, checking and answers

Each card has three hints: a prompt for finding O′, then O′ marked on the drawing, then the intercepts marked. Check answers marks each card and names the likely mistake for wrong answers; the score line counts hints used. Reveal answers shows the construction on every card and an answer key, including any distractors, which can be copied as text.

Question bank for Canvas or Moodle

The For lecturers: question bank section, below the cards, generates up to 100 questions from the current index range and set number, so the same settings always give the same bank. Two question types are available:

  • Multiple choice: one drawn plane and four answers. The three wrong answers are built from typical mistakes, and each carries its own feedback naming the mistake.
  • Matching: six planes labelled A to F in one figure, with two extra mistake-based answers, as on a printed question sheet.

Every question includes worked feedback: O′, the intercepts and the reciprocals. Download for Canvas saves a QTI 1.2 package (.zip) with the images inside; Download for Moodle saves a Moodle XML file with the images embedded. In Canvas, import the package under Settings, Import course content, choosing QTI .zip file, into Classic Quizzes; New Quizzes can drop images from QTI packages. Canvas imports the bank as a practice quiz with unlimited attempts, which you can change after import. In Moodle, import the XML file into the question bank. Try a small bank first.

Files save straight to your downloads folder.

Figures for quizzes

Copy figure… renders all six cells in black and white, ready to copy or save as a PNG, with label boxes A to F, in the style of a printed question. Tick Include answers for a key version. The set number appears in the corner of the image so the set can be recreated later. The views in the image follow each card's current rotation.

Non-cubic cells

Crystal systems

SystemCellExample loaded
Tetragonala = b ≠ c, all angles 90°rutile TiO₂
Orthorhombica ≠ b ≠ c, all angles 90°aragonite CaCO₃
Hexagonala₁ = a₂ ≠ c, γ = 120°magnesium

The cell is drawn to its true proportions. Intercepts are fractions of each edge, so the indexing rule is the same as for a cube; what changes is d, the angles between planes, and which planes are equivalent.

Miller–Bravais indices

Hexagonal cells are drawn as the full hexagonal prism (three unit cells) with three basal axes a₁, a₂ and a₃ = −(a₁ + a₂) at 120°, and c perpendicular to them. Enter h, k and l; the tool fills in i = −(h + k). The origin sits at the centre of the basal hexagon and moves to the centre of the top face only when l is negative, because the hexagon reaches equally far in both directions along each a-axis. The working names the plane as basal, first- or second-order prism, or pyramidal, and gives the equivalent three-index form by dropping i.

To convert a four-index direction [u v t w] to three indices, use [U V W] = [u − t, v − t, w]. Going the other way, u = (2U − V)/3, v = (2V − U)/3, t = −(u + v), w = W. If this gives thirds, multiply all four indices, w included, by 3: [0 1 1] becomes [−1 2 −1 3].

hcp atoms

In the hexagonal cell, tick Fill the prism with hcp atoms to place atoms at the prism corners, at the centres of the top and bottom faces (the A layers) and three inside at half height (the B layer). The colours follow the cubic tab, and the card states whether the reflection is allowed. Load (0 0 0 1): the B layer sits exactly halfway between the basal planes and cancels the reflection, which is why the first basal reflection of hcp metals is (0 0 0 2). The card also compares c/a with the ideal value √(8/3) = 1.633.

Directions

Tick Draw a direction to add an arrow in any of the three systems. In hexagonal cells, directions use four indices [u v t w]; enter u, v and w and the tool fills in t = −(u + v). The card converts to three-index [U V W] = [u − t, v − t, w], names the axis the direction runs along when it is one of a₁, a₂, a₃ or c, applies the zone law (hu + kv + it + lw = 0 when the direction lies in the plane) and otherwise gives the angle to the plane normal. The Try buttons load common directions such as [2 −1 −1 0], which runs along a₁.

Spacing, angle and equivalents

The Plane spacing card uses the formula for the chosen system (see Theory reference) and gives 2θ. It also gives the angle between the direction with the same indices and the plane normal, which is zero only in cubic cells and special cases. The Equivalent planes card lists the form with its multiplicity; for hexagonal cells it also lists the same planes in three-index notation, where the family resemblance is much harder to see.

X-ray diffraction

This tab connects planes to an X-ray experiment. The drawing shows the unit cell with its atoms and one family of planes. Blue rays arrive at the angle θ to the planes and leave at the same angle; the gold diffracted beam brightens when the waves from all the planes add up. The simulated powder pattern underneath shows every reflection of the crystal, with a cursor at the current 2θ.

Setting up

  • Structure: simple cubic, BCC, FCC, rock salt, CsCl or diamond. Each loads a real cell edge (α-polonium, α-iron, copper, sodium chloride, caesium chloride, silicon), which you can change.
  • X-ray source: Cu, Co or Mo Kα₁, or any wavelength from 0.2 to 3 Å.
  • Crystallite size: 5, 20 or 100 nm. Smaller crystallites contain fewer planes, so their peaks are broader (the Scherrer effect).
  • Planes: type h, k and l. The beam jumps to the first Bragg angle of those planes.

Changing the angle

Move θ with the slider, with the ±0.02° buttons, or by dragging along the powder pattern. When you let go of the slider close to a peak, it snaps onto the peak. Scan 2θ sweeps the pattern from low to high angle and pauses on every peak.

A scan always switches the drawing to the planes behind each peak, so it walks through every reflection in turn. When you move the angle yourself, the drawing stays with your planes and the Bragg condition card names the planes responsible for any peak under the cursor, with a button to show them. Tick Switch automatically to the planes that diffract to switch as you move; the card then says which planes it switched from and to.

Reading the result

  • Bragg condition: whether 2d sin θ is a whole number of wavelengths, worked through with the current numbers, an intensity meter for these planes, and the orders n = 1, 2, 3 … of the planes. Click an order to go to its angle. There are three outcomes: the condition is met and a peak appears (green, or orange when the peak is weak); the condition is met but atoms halfway between the planes cancel the reflection (red); or the path difference is not a whole number of wavelengths and nothing is diffracted.
  • Path difference and interference: the classic Bragg construction, with the extra path 2d sin θ in orange, and the wave leaving each layer of atoms on the right. When every crest lines up with the dashed line, the waves add. Atoms halfway between the planes (red) send waves exactly out of step at the first-order angle. The bottom row is the sum over all the planes of a crystallite.
  • Powder pattern: peaks are labelled with their indices, and the peak under the cursor turns gold. Red marks on the axis show where systematically absent reflections would fall. Triangles under the axis mark the orders of the selected planes, hollow when absent. Click a peak or a red mark to show its planes.
  • Reflections table: every reflection up to 2θ = 160° with N = h² + k² + l², d, 2θ and relative intensity. The sequence of N values that give peaks identifies the lattice type. Click a reflection to show its planes.

One crystal and a powder

The drawing shows a single crystal turned so that the chosen planes make the angle θ with the beam. A powder contains crystallites in every orientation, so at any angle some of them are turned this way. That is why the powder pattern shows all the reflections at once.

Peaks to planes

This tab runs the app in reverse: from the peaks of a powder pattern back to the planes, the lattice type and the cell edge. Each pattern comes from a cubic crystal measured with Cu Kα₁ radiation (λ = 1.5406 Å). The first eight peaks with at least 1% of the intensity of the strongest are numbered, and their 2θ values appear in the worksheet.

The worksheet

  1. sin²θ for each peak, from θ = 2θ/2.
  2. ÷ peak 1: each sin²θ divided by the sin²θ of peak 1.
  3. N: the ratios multiplied by the smallest whole number that makes every one a whole number. Because sin²θ = (λ²/4a²)(h² + k² + l²), these are N = h² + k² + l².
  4. h k l for each peak, with h² + k² + l² = N and allowed by the lattice.
  5. Lattice type from the sequence of N: primitive 1, 2, 3, 4, 5, 6, 8 … (7 never occurs); body-centred 2, 4, 6, 8 …; face-centred 3, 4, 8, 11, 12, 16 ….
  6. Cell edge a = λ√N / (2 sin θ), most precisely from a high-angle peak.

Check marks every filled cell and gives targeted feedback. It recognises a calculator in radians, using 2θ instead of θ, forgetting to square the sine, ratios entered as N, and N values that cannot be h² + k² + l² (such as 7), which means the values must be doubled. A body-centred pattern looks primitive until you notice this. Hint gives the next step for the first unfinished column. Fill in a column for me fills one column, so students can concentrate on the reasoning rather than the arithmetic. Reveal answers asks for a second click. Clicking a peak highlights its row, and a solved pattern shows the indices on the peaks.

Crystals chooses between simple metals (primitive, body- or face-centred) and a harder set that adds rock salt, CsCl and diamond. Rock salt and diamond are face-centred, and CsCl is primitive. The same pattern number and choice of crystals always give the same pattern.

Single crystal

A powder pattern squeezes every family of planes onto one 2θ axis. A single crystal keeps the directions too: each family of planes sends its diffracted beam in its own direction, but only when the crystal is turned so that those planes make the Bragg angle with the beam. This tab shows that in three linked views.

The diffractometer

The X-ray beam comes from the source on the left, passes through the crystal and is stopped in the middle of a flat detector on the right. Dragging rotates the crystal, unlike the other tabs, where dragging turns the camera: beam and detector never move, as in a real diffractometer. The arrow keys rotate it in small steps (larger with Shift), −1° and +1° turn it about the vertical axis, and Rotate spins it slowly about that axis. The unit cell shows its atoms and the planes of the selected reflection: gold atoms lie on the planes, red ones halfway between. The crystal is drawn far larger than life; the detector is to scale only in the detector image.

The Ewald construction

Every family of planes (h k l) is represented by one point of the reciprocal lattice, a vector G from the origin O that is normal to the planes and 1/d long. The incident beam is the vector k₀, length 1/λ, ending at O. The Ewald sphere has radius 1/λ and is centred at C, the start of k₀. When a reciprocal lattice point lies on the sphere, the diffracted beam runs from C to that point, k = k₀ + G, and Bragg's law holds: |G| = 1/d = 2 sin θ/λ. Rotating the crystal rotates the reciprocal lattice about O, so points sweep through the sphere one after another. Reciprocal lattice shows all points or one layer through O. Bigger dots give stronger reflections; red rings mark points on the sphere whose reflection is systematically absent.

The detector image

The detector is a 100 mm square, seen from the crystal, with rings of constant 2θ. A spot's distance from the centre is D tan 2θ for a detector at distance D. A still crystal gives only the few spots whose points touch the sphere. Tick Collect spots while rotating and press Rotate to keep every spot as it flashes up: one full turn about a crystal axis gives a rotation photograph, with the spots on curved layer lines (straight on a cylindrical film, hyperbolas on a flat detector). Each spot is recorded where its reciprocal lattice point actually crosses the sphere, so it does not matter how fast or in what steps the crystal turns, and every reflection that the turn can reach appears twice, once as its point enters the sphere and once as it leaves. Spots can lie close together: reflections with similar d on the same layer line, such as (4 0 0) and (4 2 0) of rock salt with Mo Kα, really are only a few millimetres apart on a flat detector 60 mm away. Symmetry-equivalent reflections such as (2 0 0), (0 2 0), (−2 0 0) and (0 −2 0) even land on exactly the same point when the crystal turns about c. Click a collected spot to list the reflections in it. Click a live spot, or a row of the list, to select its reflection; Follow the strongest spot again undoes the choice.

Intensities

A reflection's strength is |F|² × the polarisation factor (1 + cos² 2θ)/2 × a common fall-off with angle. Live spots show the momentary intensity of a mosaic crystal. It also falls as 1/sin 2θ: the spread of block orientations smears each reciprocal lattice point across the sphere over a distance proportional to |G| cos θ, that is to sin 2θ, so at any moment a smaller share of a high-angle point touches the sphere. Collected spots show the integrated intensity of the whole pass through the sphere, which includes the Lorentz factor: the time the point takes to cross the sphere. For spots on the equator of the detector this is 1/sin 2θ; above and below it, points circle the axis more slowly, so at the same 2θ their spots are stronger. Spots that land on the same point add up, and the collected image is scaled to its strongest spot, like the contrast of a detector.

Settings

X-ray source: Mo Kα is the usual single-crystal source. The app uses the Kα₁ line, 0.7093 Å; diffractometer software normally uses the Kα mean, 0.71073 Å, which shifts 2θ by about 0.2%. Ag Kα reaches further into reciprocal space; with Cu Kα the sphere is small, and a cubic metal gives very few spots. Detector distance sets the largest 2θ caught in the corners: a closer detector catches more. Mosaic spread is the small misalignment of the blocks in a real crystal, given here as the standard deviation of their orientations; it sets how far a point can be from the sphere and still diffract, so a larger value makes spots last longer while the crystal turns. It changes how long a spot is lit, not where collected spots fall or how strong they are. Orientation puts c, [1 1 0] or [1 1 1] vertical, or picks a random orientation.

Links and worksheets

Shareable links

Copy link in the header copies a link that opens the app on the current tab with its settings: the indices, structure, angle, set number, pattern number or crystal orientation. For example, a link can open the X-ray tab on diamond (2 2 2) at its Bragg angle, ready to discuss the missing peak. Paste such links into slides, emails or a course page. The settings travel after the # in the address, so they also work in an offline copy of the file.

Printable worksheets

Printable worksheet… is in the For lecturers section of Matching set, on the Step by step tab and on the Peaks to planes tab. It makes four kinds of sheet: planes to write, planes to match from a list (with two mistake-based distractors), directions to write, and a powder pattern to index with a blank table. Choose 6, 9 or 12 questions, the index range and a title, and whether to add an answer page. The answer page shows the construction for each question: O′ and the intercepts for planes, head − tail for directions, and the completed table for a pattern. Print or save as PDF opens the browser's print dialog. The same worksheet number always gives the same sheet.

Theory reference

Interplanar spacing

Cubic1/d² = (h² + k² + l²)/a²
Tetragonal1/d² = (h² + k²)/a² + l²/c²
Orthorhombic1/d² = h²/a² + k²/b² + l²/c²
Hexagonal1/d² = 4(h² + hk + k²)/(3a²) + l²/c²

Bragg's law: nλ = 2d sin θ. The reflection (nh nk nl) is the nth order from the (h k l) planes.

Structure factor and absences

F(hkl) = Σj fj exp[2πi(hxj + kyj + lzj)], summed over the atoms of the conventional cell. An atom on an (hkl) plane has hx + ky + lz equal to a whole number and scatters in phase; one exactly halfway between planes scatters in antiphase.

StructureReflection allowed when
Simple cubicalways
BCCh + k + l is even
FCCh, k, l all odd or all even
Rock saltas FCC; all even: F = 4(fNa + fCl), strong; all odd: F = 4(fCl − fNa), weak
CsClalways; h + k + l even: F = fCs + fCl, strong; odd: F = fCs − fCl, weak
Diamondall odd (|F|² half the maximum), or all even with h + k + l a multiple of 4
hcpabsent when h + 2k is a multiple of 3 and l is odd; otherwise |F|² is 100%, 75% or 25% of the maximum

To judge strong and weak reflections, the tool uses the electron counts at sin θ/λ = 0 as scattering factors: f(Na⁺) = 10, f(Cl⁻) = 18, f(Cs⁺) = 54 and f(C) = 6. Real intensities also depend on the scattering angle, thermal motion, the Lorentz-polarisation factor and multiplicity.

Simulated powder intensities

The pattern uses I = M · LP · |F|² · exp(−2B sin²θ/λ²), scaled so the strongest peak is 100. M is the multiplicity, LP = (1 + cos² 2θ)/(sin² θ cos θ) the Lorentz-polarisation factor, and the exponential, with B = 4 Ų, stands in for the fall-off of the atomic scattering factors and for thermal vibration. Forms with the same N = h² + k² + l², such as (3 0 0) and (2 2 1), fall at the same angle and are added. Each peak has a Gaussian profile whose width combines the Scherrer broadening β = 0.94λ/(L cos θ) with 0.05° from the instrument.

Diffraction from one family of planes

The intensity meter and the wave panel use s = 2d sin θ/λ, the path difference between neighbouring planes in wavelengths. The relative intensity is |F(s)|²/(Σf)² × [sin(Nπsg)/(N sin(πsg))]², where F(s) = Σj fj exp[2πi s(hxj + kyj + lzj)], g is the common factor of h, k and l, and N is the number of lattice planes in a crystallite of size L. The second factor, the interference function, is 1 when sg is a whole number and falls away faster the more planes there are, which is why peaks from large crystallites are sharp.

Planar density

The tool finds every atom with hx + ky + lz equal to the plane's constant in a block of 11 × 11 × 11 cells. The atoms of each sublattice (each set of identical atoms related by lattice translations) form a two-dimensional lattice in the plane, so the two shortest independent in-plane vectors span the area belonging to one atom. The densities of the sublattices are added, which also covers structures such as diamond that are not lattices themselves. The result is given in atoms per a²; in ionic structures both ions are counted.

Multiplicities

System (point group)Forms and multiplicities
Cubic (m3̄m){h00} 6, {hh0} 12, {hhh} 8, {hk0} 24, {hhl} 24, {hkl} 48
Tetragonal (4/mmm){00l} 2, {h00} 4, {hh0} 4, {hk0} 8, {h0l} 8, {hhl} 8, {hkl} 16
Orthorhombic (mmm){h00}, {0k0}, {00l} 2; {hk0}, {h0l}, {0kl} 4; {hkl} 8
Hexagonal (6/mmm){000l} 2, {h0h̄0} 6, {hh2h̄0} 6, {hki0} 12, {h0h̄l} 12, {hh2h̄l} 12, {hkil} 24

Directions and zones

In a cubic cell, the angle φ between a direction [u v w] and the normal of (h k l) satisfies cos φ = (hu + kv + lw)/(√(h² + k² + l²) √(u² + v² + w²)). When hu + kv + lw = 0, the direction lies in the plane and is a zone axis of it (the Weiss zone law, which holds in every crystal system).

Teaching ideas

  • Absences in a lecture. In Single plane, choose FCC and press Compare (1 0 0), then (2 0 0). The red face-centred atoms halfway between the (1 0 0) planes show why that reflection cancels, and why it reappears as (2 0 0).
  • A self-study path. Step by step at ±1, then ±2, then a typed Matching set at ±2 or ±3. The tally gives students an honest measure of progress.
  • A workshop exercise. Put a set number on screen. Students load it, match or type their answers, and check. Reveal the answers together at the end.
  • Assessment. Copy a set figure without answers into a quiz, and keep the version with answers and the copied answer key for marking. Use typed answers or mistake-based distractors so the question tests the method, not elimination.
  • Beyond FCC. Switch the same planes to diamond: (1 1 1) survives at half intensity while (2 0 0) and (2 2 2) vanish. Switch to CsCl and compare it with BCC: (1 0 0) becomes weak rather than absent.
  • Close packing. In Non-cubic cells, choose hexagonal, fill the prism with hcp atoms and compare (0 0 0 1) with (0 0 0 2).
  • An online question bank. Generate 20 multiple-choice questions for Canvas or Moodle as a formative quiz, and use the mistake-based feedback to see which errors are common.
  • Missing peaks. In X-ray diffraction, choose FCC and type (1 0 0). The beam reflects at the Bragg angle, but the red face-centre atoms halfway between the planes cancel it. Click the order n = 2 to watch (2 0 0) appear.
  • Indexing a pattern. Give students the 2θ values of the first peaks, ask them to compute the ratios of sin²θ, and identify the lattice from the sequence of N values. They can then check their answer against the reflections table.
  • Peak width and wavelength. Change the crystallite size from 100 nm to 5 nm and watch the peaks broaden; change the source from Cu to Mo and watch every peak move to lower angle.
  • Why four indices. In Non-cubic cells, choose hexagonal, load (1 0 −1 0) and compare the four-index and three-index lists of its equivalent planes.
  • Beyond cubic. In Non-cubic cells, load (1 0 1) in a tetragonal cell and read the angle between [1 0 1] and the plane normal, then compare with the cubic case.

Keyboard and accessibility

  • Every drawing can take keyboard focus; the arrow keys then rotate it.
  • In step 1, corners can be chosen from a list of coordinates instead of clicking the drawing.
  • Enter checks the answer in the step-by-step inputs and in typed matching answers.
  • The powder pattern can take keyboard focus; the arrow keys then move 2θ by 0.05°, or by 1° with Shift.
  • On the Single crystal tab, the arrow keys rotate the crystal by 0.5°, or by 5° with Shift, from either the diffractometer or the Ewald drawing. Every spot is also listed in the table of reflections.
  • Information shown by colour is also given in words: the reflection status, the working, and the hint and feedback texts.
  • The page follows the device's light or dark setting and works at phone width.

Troubleshooting

ProblemWhat to do
Symbols appear garbled, for example "…"The file must be read as UTF-8. It declares this itself; if a server overrides it, serve the file with charset=utf-8.
Copy image does nothingSome browsers block copying images. Right-click the image and choose Copy Image or Save Image As.
A drawing looks crowdedRotate it, or use Reset view. For forms with many members, such as {3 2 1}, switch off Equivalent planes after viewing.
The question-bank buttons are greyed outThis view cannot save files. Open the standalone HTML file or a GitHub Pages copy.
Images are missing after a Canvas importImport into Classic Quizzes. New Quizzes can drop images from QTI packages; migrate the quiz afterwards if needed.
A typed answer is not acceptedEnter three whole numbers separated by spaces or commas, with minus signs for negatives.

Validation and limits

Checked against standard values

  • Planar densities: FCC {1 1 1} = 4/(√3 a²) = 2.309 a⁻², BCC {1 1 0} = √2 a⁻² = 1.414 a⁻², rock salt {1 0 0} = 4 a⁻² counting both ions.
  • Absences: BCC (1 0 0) and (1 1 1) absent; FCC (1 0 0), (1 1 0) and (2 1 1) absent; rock salt (1 1 1) weak with |F|² about 8% of the maximum.
  • Hexagonal spacing: magnesium (1 0 −1 0), d = 2.779 Å, 2θ = 32.2° with Cu Kα₁.
  • Simulated powder pattern of copper with Cu Kα₁: (1 1 1) at 43.32°, (2 0 0) at 50.45° and (2 2 0) at 74.13°, with relative intensities 100, 46 and 21, against 43.30°, 50.43°, 74.13° and 100, 46, 20 in the ICDD reference pattern 04-0836. For sodium chloride and silicon, intensities agree with reference patterns to within about 15 percentage points.
  • Further absences: CsCl (1 0 0) weak at 25% of the maximum; diamond (2 0 0) and (2 2 2) absent, (1 1 1) at 50%; hcp (0 0 0 1) absent, (1 0 −1 0) at 25%, (1 0 −1 1) at 75%, (0 0 0 2) at 100%.
  • Multiplicities: all forms listed in the Theory reference.
  • Single crystal: sodium chloride with Mo Kα₁ gives (2 0 0) at 2θ = 14.45° and (2 2 0) at 20.49°, 15.5 mm and 22.4 mm from the beam centre at a 60 mm detector distance, as expected from Bragg's law and D tan 2θ.

Current limits

  • Atoms are placed for six cubic structures and for hcp; tetragonal and orthorhombic cells have no atoms.
  • Monoclinic, triclinic and rhombohedral cells are not included.
  • Shareable links and printing work in the standalone page (and on GitHub Pages), not in the hosted Claude view.
  • The diffraction simulator covers cubic structures only. It uses one scattering factor per element with a common fall-off, and ignores the Kα₂ line, absorption and preferred orientation, so its intensities are a guide rather than a quantitative prediction.
  • The single-crystal simulator covers cubic structures only. Spot intensities use |F|², polarisation, a common fall-off and, for collected spots, the Lorentz factor; absorption and extinction are ignored, and one wavelength is used (no Kα₂ or white radiation). The detector is flat, square and perpendicular to the beam, and the mosaic spread is modelled as a Gaussian tolerance.
  • Question banks are cubic-cell questions. Canvas packages follow the QTI 1.2 format Canvas exports; test a small bank in your own course first.
  • Scattering factors are simplified (see Theory reference); intensities are qualitative.
  • Indices are limited to the range −9 to 9.

Cite and licence

If you use Miller & Bragg in teaching or research, please cite it.


        

BibTeX


        

Licence

© 2026 Prof. Peter Nockemann. The text, design and code of Miller & Bragg are licensed under the Creative Commons Attribution 4.0 International licence (CC BY 4.0). You may copy, share and adapt it for any purpose, including in your own teaching materials, provided you give appropriate credit, link to the licence and indicate any changes. The app contains no third-party code, fonts or images.

Release details

Version history

1.1.0October 2026. Feedback button with an optional, anonymous survey, loaded only when opened; the Zenodo DOI in the citation and footer.
1.0.0October 2026. First public release: single plane with six cubic structures, directions, families and equivalent planes; step-by-step practice; matching sets with question-bank export for Canvas and Moodle; tetragonal, orthorhombic and hexagonal cells with hcp atoms and four-index directions; X-ray diffraction simulator with a simulated powder pattern; Peaks to planes indexing exercise; single-crystal diffraction with the Ewald construction and rotation photographs; directions practice; shareable links; printable worksheets; guided tour; manual and glossary.

Printable worksheet

Your browser's print dialog prints the worksheet or saves it as a PDF. The same worksheet number always gives the same questions and answers.

Figure for a quiz or slide

Exported unit cell figure
If copying is blocked, right-click the image and choose Copy Image or Save Image As.

Feedback

The form is anonymous and takes about five minutes. It is a Microsoft Form, so it loads from Microsoft only when you open this window. If it does not appear below, open the form in a new tab.