Unit Cell Calculator – Density, Atomic Radius, Packing and Miller Indices
A unit cell is the smallest box of atoms that, repeated in three directions, builds the whole crystal. Its shape and contents fix almost every bulk property you meet in general chemistry and materials science: how dense the solid is, how big its atoms are, how tightly they pack and how far apart its atomic planes lie. This unit cell calculator links those quantities for cubic, hexagonal close-packed and ionic structures, works in any of the seven crystal systems, and turns Miller indices into d-spacings and plane drawings.
Counting atoms per unit cell
Atoms on the boundary are shared. A corner atom is shared by 8 cells, an edge atom by 4 and a face atom by 2, so they count ⅛, ¼ and ½; an atom fully inside counts 1. Face-centred cubic therefore holds 8 × ⅛ + 6 × ½ = 4 atoms, body-centred cubic 2, simple cubic 1 and diamond cubic 8. The hexagonal prism usually drawn for HCP holds 12 × ⅙ + 2 × ½ + 3 = 6. This number of atoms per unit cell is Z.
Edge length and atomic radius
Treat atoms as hard spheres and find the direction in which they touch. That contact gives the edge length to atomic radius relation for each structure:
- Simple cubic: atoms touch along the edge,
a = 2r. - BCC: along the body diagonal,
a√3 = 4r(see the cube diagonal calculator). - FCC: along the face diagonal,
a√2 = 4r. - Diamond cubic: along a quarter of the body diagonal,
a√3/4 = 2r.
Packing efficiency and the 74 % limit
The packing efficiency is the fraction of the cell filled by spheres: Z · (4/3)πr³ / V. Each sphere's volume is the one the sphere volume calculator gives, and the cell volume is a³ (volume of a cube). The results are fixed by geometry: 52.36 % for simple cubic, 68.02 % for BCC, 34.01 % for diamond and 74.05 % for both FCC and HCP. No arrangement of equal spheres beats π/(3√2) ≈ 74.05 %, a bound Kepler guessed in 1611 and Hales proved in 1998.
Density from the unit cell
The mass of one cell divided by its volume is the crystal density:
ρ = Z·M / (N_A·a³)with M in g/mol, NA = 6.022 140 76 × 10²³ mol⁻¹ and a in centimetres (1 pm = 10⁻¹⁰ cm). Copper is FCC with a = 361.49 pm, so ρ = 4 × 63.546 / (6.022 × 10²³ × (3.6149 × 10⁻⁸)³) = 8.935 g/cm³. Rearranged, the same relation finds the edge length from a measured density, identifies an unknown metal from its molar mass, or decides whether a cubic metal is BCC or FCC by solving for Z. For bulk objects rather than crystals, use the density calculator, and convert units with the density converter.
Ionic structures and the radius-ratio rule
In ionic crystals such as rock salt, caesium chloride, zinc blende and fluorite, the cation–anion contact distance r₊ + r₋ follows from a, and the radius ratio r₊/r₋ predicts the cation's coordination number: below 0.225 three-fold, 0.225–0.414 tetrahedral, 0.414–0.732 octahedral and above 0.732 cubic.
Miller indices and d-spacing
A plane that cuts the axes at a/h, b/k and c/l has Miller indices (hkl): take the reciprocals of the intercepts and clear fractions. In a cubic crystal the spacing between neighbouring (hkl) planes is d = a / √(h² + k² + l²); other systems use the reciprocal metric tensor, which this tool applies to all seven. That spacing is the d in Bragg's law, so a Bragg's Law Calculator can turn it into a diffraction angle. Planar and linear densities follow from d, the cell volume and the lattice centring.
HCP versus FCC stacking
Both close-packed structures stack the same hexagonal layers of touching spheres. HCP repeats every second layer (ABAB) and FCC every third (ABCABC); looking down the FCC body diagonal [111] reveals those layers. Real HCP metals deviate from the ideal axial ratio c/a = √(8/3) ≈ 1.633: magnesium is close to it, while zinc (c/a ≈ 1.86) is stretched, so its atoms touch only within the basal plane and it packs below 74 %.