Lattices of ionic solids are infinite arrays which are characterised by a smaller portion of the lattice that is referred to as a unit cell. The unit cells for some metallic lattices are shown at the right. The
unit cell is the
simplest repeating unit for the lattice, and the entire lattice could be generated by stacking unit cells together infinitely in three dimensions.
For an ionic solid, the unit cell contains both cations and anions. Because the unit cell is representative of the entire lattice, the
ratio of the number of cations to the
number of anions inside the unit cell must be the
same as for the entire lattice.

We can count the number of atoms in total that are in a unit cell by combining the fractions of atoms within the unit cell boundaries. The fraction contributed for atom depends on its position in the unit cell. Consider the cubtic unit cells shown at the right.
The spheres that represent metal atoms are cut into segments by the perpendicular planes forming the faces of a cubic unit cell just as an orange is cut into segments with a knife.
For a cubic unit cell - body-centred atoms are completely inside.
- corner atoms contribute 1/8 (cut in half by three successive planes), or viewed from a different perspective, each corner atom is shared by 8 unit cells.
- face atoms contribute 1/2 (cut in half by one plane), or viewed from a different perspective, each face atom is shared by 2 until cells.
For the metal in the graphics above represented by the
pinkish atoms, there are 8 atoms at corners, 1/8 of which are within the unit cell giving one atom total is inside the unit cell.
blueish atoms, there are 8 atoms at corners, 1/8 of which are within the unit cell and one atom completely inside, giving two atoms within the unit cell.
green atoms, there are 8 atoms at corners and 6 atoms at faces. Thus there are 8 × 1/8 plus 6 × ½ equals 4 atoms within the unit cell.
The same principle can be used to deduce the number of cations (anions) inside the unit cell for an ionic compound.