Sphere Packing Calculator

How many balls actually fit in a container — using real packing densities rather than assuming the spheres fill the space, with void volume and the wall effect accounted for.

  • Real packing densities
  • Wall-effect correction
  • Void space reported
r spheres ≈ 64% · gaps ≈ 36%

Poured spheres fill only about 64% of a container — the rest is the gaps between them. Perfect hand-stacked packing reaches 74.05%, never more.

Working N = Vcontainer × φ ÷ Vsphere
Spheres that fit

Enter the container and sphere sizes.

Quick answer: N = Vcontainer × φ ÷ Vsphere, where φ ≈ 0.64 for anything poured and settled. A 1-litre jar of 16 mm marbles holds about 298. The theoretical maximum is 74.05% but you cannot reach it by pouring — only by placing spheres by hand.

The number that decides everything

Spheres never fill their container. The fraction they do fill — the packing density φ — varies by more than 30% depending purely on how they got there, and picking the wrong one is the dominant error in any estimate.

Packing densities for identical spheres
ArrangementExact valueφVoidHow you get it
Random loose pourempirical0.55–0.60~42%Poured gently, not settled
Random close packingempirical0.6436%Poured and settled — the usual case
Vibrated / tappedempirical0.66–0.68~33%Mechanically shaken while filling
Body-centred cubicπ√3/80.6801731.98%A crystal lattice, not achievable by pouring
Close packing (FCC/HCP)π/(3√2)0.7404825.95%Placed by hand — fruit stacks, cannonballs
Simple cubicπ/60.5236047.64%Spheres in a grid — deliberately inefficient

The 74% trap. Search for sphere packing and you will find 74.05% everywhere, because it is the mathematically famous number. It is also the wrong number for almost every practical question. Pouring balls into a container gives 64% — no amount of shaking gets you to 74%, because that requires a perfect crystalline lattice, and disordered packings jam at a lower density long before they can order themselves. Using 74% overestimates your sphere count by about 16%.

Sphere size does not change the density

This one is genuinely counter-intuitive, and it is worth internalising because it simplifies the whole problem.

A jar of ball bearings and a jar of tennis balls both fill to about 64%. The number of spheres changes enormously, but the fraction of space occupied does not. Packing density is a dimensionless ratio, and scaling every sphere by the same factor scales every gap by the same factor too — the geometry is unchanged.

Same 1-litre jar, different spheres, random close packing at φ = 0.64
SphereDiameterVolume eachCountGlass/steel volume
Airsoft pellet6 mm0.1131 cm³5,659640 cm³
Marble16 mm2.1447 cm³298640 cm³
Golf ball42.7 mm40.75 cm³15640 cm³
Tennis ball67 mm157.5 cm³4640 cm³

The last column is the point: whatever you pour in, you end up with 640 cm³ of material and 360 cm³ of air. This has a practical consequence — if you are buying by weight, sphere size is irrelevant to how much you need. If you are buying by count, it matters enormously.

The caveat is small containers. Once the container is only a few sphere diameters across, the counts above stop being reliable — see the wall effect below.

The wall effect

A flat wall is bad news for packing. Spheres against it are forced into a layer that cannot interlock with anything behind, so density drops within roughly one sphere diameter of every surface.

How much this costs you depends on the container's surface-area-to-volume ratio — which means it depends on how many spheres wide the container is:

Packing loss from wall effects, starting from φ = 0.64
Container widthEffective φLossPractical example
3 sphere diameters0.5776−9.8%Marbles in a narrow test tube
5 diameters0.6135−4.1%Golf balls in a shoebox
10 diameters0.6309−1.4%Marbles in a jam jar
20 diameters0.6365−0.6%Peas in a bucket
50 diameters0.6388−0.2%Ball pit, grain silo — negligible

These come from a standard packed-bed voidage correlation, which adds an extra void increment of 0.05/(D/d) + 0.412/(D/d)² to the bulk value. The calculator applies exactly this formula when you give it container dimensions, and flags when the container is narrow enough to matter. Below about two sphere diameters the correlation breaks down entirely — spheres go single-file and no formula helps.

Note how fast the effect fades: at 10 diameters across you lose only about 1.4%, and by 20 it is under half a percent. Wall effects are a real correction for tubes and small jars, and a rounding error for anything bigger. The bigger prize in a guessing-jar contest is still remembering to use 0.64 at all rather than assuming the marbles fill the jar.

Beating 74% — mix the sizes

Kepler conjectured in 1611 that no arrangement of equal spheres beats 74.05%. Thomas Hales proved it in 1998, and a formal computer-checked proof was completed in 2014 — one of the longest-standing problems in geometry, finally closed.

But that limit only binds for identical spheres. Mix sizes and you can do far better, because small spheres drop into the gaps between large ones instead of forcing them apart:

Where mixed-size packing is exploited
ApplicationHow it works
Concrete aggregateGraded stone, sand and cement fill each other's voids — a single stone size would need far more cement
Road base / hardcoreWell-graded fill compacts denser and carries load better than uniform gravel
Powder metallurgyBlended particle sizes raise green density before sintering
Ceramic glazesParticle-size distribution controls how tightly the fired layer packs

A well-chosen two-size blend can exceed 80%, and adding further size grades pushes higher still. This is why "well-graded" is a compliment in civil engineering and "uniformly graded" often is not — the uniform material is the one full of holes.

When the empty space is the point

For many applications the sphere count is incidental and the void fraction is the real answer. That 36% of air is doing work:

Void space as the useful quantity
ApplicationWhat the voids do
Packed catalyst bedCarries the reacting fluid past the catalyst surface
Gravel filter / soakawayHolds and drains water — void fraction is the storage capacity
Chromatography columnVoid volume determines the unretained elution time
Grain silo aerationLets air reach the centre of the mass
Ball mill chargeVoid space accommodates the material being ground

A soakaway filled with 20 mm gravel stores roughly 360 litres of water per cubic metre — not 1000. That single figure, straight out of the void fraction, decides how big the pit has to be. The calculator reports void volume alongside the count for exactly this reason.

Common mistakes & pro tips

What goes wrong, and the fix
MistakeWhat happensFix
Assuming spheres fill the containerOverestimates by ~56%Multiply by φ — about 0.64 for a pour
Using 74% for a poured containerOverestimates by ~16%74% needs hand placement, not shaking
Ignoring wall effects in a small containerOverestimates, sometimes badlyCorrect below ~10 sphere diameters wide
Using the outside dimensionsOverestimates by the wall thicknessMeasure the container's internal volume
Using diameter as radiusSphere volume 8× too large; count 8× too lowHalve the diameter first
Expecting an exact integer answerFalse precisionPacking is statistical — treat it as ±3–5%

Pro tip. If you need a genuinely accurate count for an odd container, do not compute it — measure it. Fill the container with water to find its true internal volume, then count out 50 spheres, measure their displacement, and scale. That empirically captures wall effects, container shape and any sphere size variation in one step, and it beats any formula.

How to use this calculator

  1. Choose how to define the container: a known volume, or box, cylinder or sphere dimensions. Giving dimensions lets the wall-effect correction apply.
  2. Enter the sphere diameter (or switch to radius).
  3. Pick the packing arrangement from the dropdown — random close packing is the sensible default for anything poured.
  4. Read the count, plus total sphere volume, void volume, surface area and — if you enter a density — total mass.

Frequently asked questions

What percentage of space do packed spheres fill?

It depends on the arrangement. The theoretical maximum for identical spheres is π/(3√2) = 74.05%, from face-centred cubic or hexagonal close packing. Pouring spheres in and letting them settle gives about 64%; a gentle loose pour can be 55–60%. That gap between 74% and 64% is the biggest single source of error in these estimates.

How many marbles fit in a jar?

Multiply the jar's internal volume by about 0.64, then divide by the volume of one marble. A 1-litre jar with 16 mm marbles holds roughly 298, since each marble is 2.145 cm³. Shaking to settle might get you to 310–320. Guessing contests are usually won by whoever remembers to apply 0.64 instead of assuming the marbles fill the jar.

Does the size of the spheres change the packing density?

No — provided they are all the same size. Packing density is a pure ratio, so ball bearings and tennis balls both reach about 64% on a random pour. The number changes enormously; the fraction of space filled does not. This only breaks down when the container is small relative to the spheres, where wall effects take over.

Can packing ever exceed 74 percent?

Not with identical spheres. Kepler conjectured the 74.05% limit in 1611; Thomas Hales proved it in 1998, with formal computer verification completed in 2014. But mixing sizes beats it, because small spheres drop into the gaps between large ones. Practical two-size blends can exceed 80% — which is exactly why concrete uses graded aggregate rather than a single stone size.

What is the difference between random close packing and close packing?

Close packing (74.05%) is a perfect crystalline lattice — every sphere touching twelve neighbours in a repeating pattern. Random close packing (~64%) is the densest arrangement reachable by pouring and shaking, disordered, averaging about six contacts per sphere. Real containers essentially always give the random figure; you cannot shake your way to the crystalline value, only place spheres deliberately.

Why do fewer balls fit near the walls of a container?

A flat wall forces the adjacent spheres into a layer that cannot interlock with anything behind it, so packing is looser within about one sphere diameter of any surface. The effect scales with surface area relative to volume — negligible in a ball pit, significant in a narrow tube. Starting from 0.64: ten sphere diameters across loses about 1.4%, five diameters about 4%, three diameters close to 10%. Below two diameters the spheres go single-file and no correlation applies.

How much empty space is there between packed spheres?

In a random pour at 64%, about 36% of the container is air. Even perfect close packing leaves 25.95% empty. That void is not always wasted — it carries fluid through a catalyst bed, drains water through a gravel filter, and lets air reach the middle of a grain silo. When void fraction matters more than count, it is the number worth calculating.

What packing density should I use for my estimate?

0.64 for anything poured and settled — ball pits, gumball machines, most real cases. 0.60 for a gentle pour with no settling. 0.68 if the container is vibrated during filling, as with grinding media. Reserve 0.7405 for hand-stacked arrangements like fruit displays or cannonball piles — nothing poured will reach it.

Last updated: August 14, 2026 · Crystalline densities are exact; random packing and wall-effect figures are empirical estimates and vary with sphere uniformity, container shape and filling method — treat counts as ±3–5% · Part of the specialty calculators hub · Accuracy policy