Ionic solids adopt structures to maximise the electrostatic attraction between the cations and anions. Although there are a very large number of possible structures, many are based on close packed arrangements. There are two ways for atoms to pack together as closely as possible: cubic and hexagonal close packing. These differ in how the layers fit together. These close packed arrangements have holes in which smaller atoms can be placed.

Many ionic compounds can be thought of as involving close packed anions with the cations in these interstitial holes. Investigate how the two packing arrangements and the filling of holes leads to a wide range of possible ionic crystal structures:

As the most stable structures are those in which ions surround surround themselves with as many oppositely charged ions as possible, the relative size of the cation and anion are important in determining which structure is adopted: