Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Crystal lattice builder

Build crystal structures in 3D (cubic, body- and face-centred, hcp, diamond, rock salt) and work out atoms per cell, packing and density.

Density calculator

How to use

  1. Pick an example crystal or a structure. Drag the model, or use the arrow keys, to look at it from any side. Show 2 or 3 cells along each edge to see the pattern repeat.
  2. Tick full size to see the atoms as touching spheres, the way the packing fraction counts them.
  3. The table gives the atoms per cell, each atom's nearest neighbours and how much of the space the spheres fill.
  4. In the density calculator, enter the lattice constant (the edge of the cube, in picometres) and the molar mass. The examples fill in measured values, so you can compare the calculated density with the measured one.

Keyboard and touch

TabMove between menus, the model and the calculator
Arrow keys on the modelTurn it left, right, up and down
Drag on the modelTurn it with a finger, pen or mouse
Enter in the calculatorWork out the density

Tips

  • Count shared atoms in parts: a corner atom is shared by 8 cubes, a face atom by 2, an edge atom by 4. So face-centred cubic has 8 × ⅛ + 6 × ½ = 4 atoms per cell.
  • Face-centred cubic and hexagonal close-packed both fill 74 % of space, the most any arrangement of equal spheres can (Kepler's conjecture, proved by Hales).
  • Diamond fills only 34 %: each carbon has just four neighbours, joined by strong bonds.
  • A calculated density a little different from the measured one usually comes from temperature, impurities or rounding of the lattice constant.

About this tool

Density = (formula units per cell × molar mass) ÷ (Avogadro's number × cell volume), with NA = 6.02214076 × 1023 mol−1 (exact, SI 2019). Packing fractions: simple cubic π/6, body-centred π√3/8, face-centred and hexagonal close-packed π/(3√2), diamond π√3/16. Hexagonal close-packed is drawn and counted with the ideal ratio c/a = √(8/3) unless you give c. The example lattice constants and densities are common room-temperature textbook values, rounded. The tests check every count, neighbour number and packing fraction against separate Python geometry, and every calculated example density against its measured value. Everything runs in your browser.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product