Main menuGallery

Sphere packing

This exhibit needs WebGL, which your browser or device doesn’t seem to support.
Try a recent Chrome, Edge, Firefox or Safari.

Sphere packing

How much of a box can equal spheres actually fill? Drag to orbit · scroll or pinch to zoom.

Face-centred cubic
measured · ideal 74.0 %

Arrangement

Sphere size

6

Cross-section

Cut axis
0%

Slice into the pile to see the layers — and the hollows that the next layer drops into.

The numbers

Spheres N
Radius r
One sphere ⁴⁄₃πr³
All spheres together
Box
Measured density
Ideal, endless packing
Lost at the walls
Touching neighbours

Learn

Where’s the maths? This is mensuration — the branch of geometry that measures length, area and volume — joined to a simple percentage. Every ball on screen is a sphere of volume ⁴⁄₃πr³, and the glass box is a prism of volume length × width × height, so the packing density is just one volume written as a percentage of the other. The surprise is that the answer hardly depends on how big the spheres are: it depends almost entirely on the arrangement. Stack them in a plain cubic grid and you fill only 52.4 % of the box; nudge every layer down into the hollows of the layer below and you reach 74.0 %, exactly the way a grocer stacks oranges. Johannes Kepler guessed in 1611 that 74.0 % is the best any arrangement can ever do, and nobody could prove it until Thomas Hales did in 1998 with computer help (the proof was fully machine-checked in 2014). So a question a Secondary 1 student can state took almost four centuries to settle.

📘 On the Sec 1–4 syllabus
  • Sec 2 · G5 Mensuration — 5.6 volume of a sphere
  • Sec 1 · G5 Mensuration — 5.3 volume of a prism (the box)
  • Sec 1 · N3 Percentage — 3.1 expressing one quantity as a percentage of another (packing density 74%)

Beyond the syllabus: the proof of the Kepler conjecture (1998/2014) is far beyond — enrichment.

Density = total volume of the spheres ÷ volume of the box × 100 %. With N spheres of radius r in a box measuring l × w × h that is N × ⁴⁄₃πr³ ÷ (lwh). Every number in the table is worked out from the spheres actually on screen — nothing is assumed. The glass box shrink-wraps whatever you have built.

Size does not matter. Halve the radius and each sphere holds only ⅛ as much (volume scales as r³), but about 8 times as many fit in. The two effects cancel, so the density depends on the pattern, not the scale.

For a lattice repeated for ever, the density is an exact number:

  • Simple cubic — balls straight above balls, 6 touching neighbours: π/6 ≈ 52.4 %.
  • Body-centred cubic — one extra ball at the centre of every cube, 8 neighbours: π√3⁄8 ≈ 68.0 %.
  • Face-centred cubic and hexagonal close packing — each layer sitting in the hollows of the one below, 12 neighbours: π/(3√2) ≈ 74.0 %. They are different stacking orders (ABC… and ABAB…) with exactly the same density — and by Hales’ theorem nothing can beat them.

Why the measured value is lower. Those fractions describe a lattice that runs on for ever with no edges. The glass box here shrink-wraps the pile, so on every face it reaches half a sphere past the outermost centres — and that outer skin is mostly air, because a flat wall cannot nestle into a curved surface the way the next layer of spheres would. The shortfall is roughly proportional to r ÷ s, the sphere’s radius compared with the box: at 4 spheres across, face-centred cubic falls about 15 percentage points short; at 8 across — half the radius — it falls only about 8 short. Drag Spheres across higher and watch the measured value climb; it reaches 74.0 % only in the limit of endlessly many, endlessly small spheres. Simple cubic is the exception — its layers meet the walls flush, so it tiles the box exactly and measures π/6 at every size.

Random pour is different again. Poured loose into a wide container, real balls settle near 55–60 %; shaken hard they jam at about 64 % (“random close packing”). This exhibit runs a quick, approximate settling simulation, and it tips the balls into a container only a few spheres wide with a rough, open surface on top — so it measures lower still, usually around 50 %. Read its number as a guide, not a constant. The point survives either way: no amount of luck ever reaches 74 %.

Try this: choose Face-centred and drag Spheres across from 3 up to 8. The ideal never moves, but the measured density climbs from about 52 % to about 66 % as the wasted rind becomes a smaller share of the box. Now switch to Simple cubic: same spheres, same kind of box, more than 10 percentage points of air thrown away purely by stacking badly. Finally set Cut Y to about 50 % and look straight down — can you find the hollows the next layer would sit in?

Drag to orbit · scroll or pinch to zoom · use the Cut away slider to slice through the layers.