How to calculate formula units Z in a unit cell
This post shows you how to count atoms in a unit cell and turn that count into Z.
You will also see how to check your answer in Crystal Lab and which mistakes to avoid.
What Z means and why you need it
A unit cell is the smallest block that repeats in three directions to build the whole crystal. A formula unit is the smallest group of atoms or ions that matches the chemical formula. For NaCl it is one Na+ and one Cl-. For CaF2 it is one Ca2+ and two F-.
Z is the number of formula units inside one unit cell. It is not the number of atoms. This difference causes most wrong answers.
You need Z for the density formula: ρ = Z·M / (NA·V). Here M is the molar mass of one formula unit, NA is Avogadro's number and V is the volume of the cell. If Z is wrong, the density is wrong by the same factor.
The sharing rules: corner, edge, face and interior
Atoms on the boundary of a cell are shared with neighbouring cells. You count only the part that belongs to your cell.
| Position in a cubic cell | Shared by | Share per cell |
|---|---|---|
| Corner | 8 cells | 1/8 |
| Edge (on the middle of an edge) | 4 cells | 1/4 |
| Face (on the centre of a face) | 2 cells | 1/2 |
| Interior (body) | 1 cell | 1 |
Picture a corner. Eight cubes meet at that point, so each cube owns one-eighth of the atom. An edge is touched by four cubes. A face is touched by two. An atom inside belongs to one cube only.
A cubic cell has 8 corners, 12 edges and 6 faces. Keep these numbers ready. You will use them every time.
Step-by-step method to find Z
- List where each kind of atom or ion sits: corners, edges, faces or inside.
- Multiply the number of positions by the share. For example, 8 corners × 1/8 = 1 atom.
- Add the contributions for each element separately.
- Write the ratio of the elements. Check that it matches the formula.
- Divide each count by its subscript in the formula. That number is Z.
Step 4 is a good self-check. If you get a 3:2 ratio for a compound written as AB, you have miscounted somewhere.
Worked examples
Example 1: rock salt, NaCl. Cl- ions sit at the corners and face centres. Na+ ions sit at the edge centres and at the centre of the cell.
- Cl-: 8 × 1/8 + 6 × 1/2 = 1 + 3 = 4
- Na+: 12 × 1/4 + 1 = 3 + 1 = 4
The ratio is 4:4, which is 1:1. The formula is NaCl, so Z = 4 / 1 = 4. The cell holds 8 ions, but only 4 formula units.
Example 2: fluorite, CaF2. Ca2+ ions sit at the corners and face centres. F- ions fill 8 positions inside the cell.
- Ca2+: 8 × 1/8 + 6 × 1/2 = 4
- F-: 8 × 1 = 8
The ratio is 4:8, which is 1:2. Divide by the subscripts: 4 / 1 = 4 and 8 / 2 = 4. So Z = 4.
Quick comparison of common cubic structures
| Structure | Formula | Count in the cell | Z |
|---|---|---|---|
| Simple cubic | Po | 8 corners × 1/8 = 1 | 1 |
| Body-centred cubic | W | 1 (corners) + 1 (centre) = 2 | 2 |
| Face-centred cubic | Cu | 1 (corners) + 3 (faces) = 4 | 4 |
| Caesium chloride | CsCl | 1 Cl at corners, 1 Cs inside | 1 |
| Rock salt | NaCl | 4 Na, 4 Cl | 4 |
| Zinc blende | ZnS | 4 S at corners and faces, 4 Zn inside | 4 |
| Fluorite | CaF2 | 4 Ca, 8 F | 4 |
| Antifluorite | Na2O | 4 O, 8 Na | 4 |
For an element, Z is simply the number of atoms per cell. For a compound, Z counts whole formula units. Antifluorite is fluorite with the positions of cations and anions swapped, and Z stays 4.
Checking your count in Crystal Lab
Do the count on paper first. Then use Crystal Lab to confirm it. Follow these steps.
- Open Crystal Lab and use Select structure or Search structures to pick, say, rock salt. The Random button gives you a structure to practise on.
- Switch on Cell so the edges of the unit cell are drawn. Keep the Cells option at 1, so you see a single cell.
- Rotate the cell by dragging. Find which atoms sit at corners, which on edges, which on faces and which inside.
- Set Colour to Element to separate the two kinds of ions. Counting one colour at a time is easier.
- Compare your fractions with the "How to read a unit cell" panel. It states the same sharing rules and says the viewer counts the atoms for you and divides. Check your total and your Z against it.
The Layer colour option and the Build layers control can help when you are unsure whether an atom sits on a face or inside the cell.
The Ball and Touching options and the Atom size control change how large the atoms look. If atoms hide each other, reduce the size to see the corner positions. This changes only the picture, not the count.
Use 2×2×2 or 3×3×3 only to see how the cells repeat and how atoms are shared. Do not count atoms in that bigger block when you want Z for one cell. Go back to one cell for the count.
You can also click an atom to see its coordination number (CN), the number of nearest neighbours. Its neighbours light up, and this helps you identify the structure type before you count.
Common mistakes and how to avoid them
- Counting every drawn atom as 1. A picture shows whole spheres at corners, but each belongs to eight cells. Always apply the sharing fraction.
- Giving the number of atoms as Z. NaCl has 8 ions in the cell, but Z = 4. Divide by the subscripts.
- Mixing up edge and face. An edge atom is shared by 4 cells, a face atom by 2. Learn the pairs together: edge with 4, face with 2.
- Forgetting the centre atom. In NaCl, the Na+ at the very centre of the cell counts fully. In bcc, the centre atom adds 1.
- Counting in the 2×2×2 view. That view shows eight cells. Your count will be far too large.
- Skipping the ratio check. If the counts do not match the formula, recheck the positions before you go further.
The fractions above are written for cubic cells. A hexagonal cell, such as the one in hcp, has a different shape, so its corners are shared by a different number of cells. Learn the cubic rules first. Then handle hexagonal cells separately, with the cell drawn in Crystal Lab.
Key takeaways
- In a cubic cell, a corner atom counts 1/8, an edge atom 1/4, a face atom 1/2 and an interior atom 1.
- Count each element separately, check the ratio against the formula, then divide by the subscripts to get Z.
- Z for fcc, rock salt, zinc blende, fluorite and antifluorite is 4. For CsCl it is 1.
- Do the count by hand first, then use Crystal Lab to check it on a single cell.
- Z feeds directly into the density formula, so one slip changes your final answer.
Frequently asked questions
What is the difference between Z and the number of atoms in a unit cell?
Z counts complete formula units. The atom count adds up all atoms or ions. In rock salt there are 8 ions per cell, but each formula unit has 2 ions, so Z is 4.
Why is a corner atom counted as one-eighth?
Eight cubes meet at each corner of a cubic lattice. Each cube holds one-eighth of the atom. The same logic gives one-quarter for edges and one-half for faces.
Does Crystal Lab find Z for me?
The tool's own guide says the viewer counts the atoms for you and divides. Use it to confirm your hand count. In an exam you must show the working yourself.
Why does Z matter for density?
Density is ρ = Z·M / (NA·V). Z tells you how much mass sits in the cell volume V. A wrong Z gives a wrong mass and so a wrong density.
Can I use these fractions for every crystal?
The fractions 1/8, 1/4 and 1/2 apply to cubic cells. For other cell shapes, the sharing at the boundary can differ, so check the geometry of the cell before you count.
What to do next. Try it yourself on the page below.
Chemistry — PYQs, Periodic Table, Calculator & Notes →