Why does coffee spill when you walk with it?
― The liquid in your cup has a "rhythm" it loves to slosh at
Your hand barely tilts, yet after a few steps the liquid is spilling over the rim. It isn't clumsiness. The surface of your coffee has a speed at which it loves to slosh, and that speed sits right next to the natural rhythm of your walk.
You carry a freshly poured coffee from the kitchen to your desk. It's filled right to the brim.
The first two or three steps are fine. But around the fifth step, the surface starts swinging back and forth wildly. Even though you're walking carefully, brown drops spill over the rim.
Yet the same amount of liquid in a small sake cup barely spills at all. What changes with size?
There are only two reasons it spills
The liquid in a cup naturally likes to slosh back and forth at a particular speed. In an ordinary mug, that speed happens to sit close to the rhythm of your hand as you walk.
Once the surface starts sloshing, it doesn't settle quickly. While the sloshing from the last step is still going, the next step pushes at the same moment, so the motion adds up.
Think of a playground swing. Push it at just the right moment, again and again with small pushes, and it swings higher and higher. The same thing is happening to the coffee in your cup.
The surface of a cup wants to slosh at a fixed rhythm
Try nudging a cup sideways and letting it settle. The surface rises on one side, then the other, back and forth for a while. This back-and-forth happens at a fixed speed for any given cup. Let's call this its "natural rhythm."
This rhythm is mostly set by the width of the cup. The wider the cup, the further the liquid has to travel each way, so it sloshes more slowly. The narrower the cup, the faster and busier the sloshing.
An ordinary mug (about 7 cm across) is thought to slosh back and forth roughly 3 to 4 times a second. Meanwhile, a person's hand swings back and forth about twice a second while walking. On top of that, the walking motion also contains a finer wobble at twice that speed. Look at the graph on the right in Figure 1. The peak for the mug sits right next to the band where the walking-motion components cluster.
When the rhythms line up, even a small hand movement lets the surface build up a large slosh. This is called "resonance." A small cup's peak shifts to the right, so it doesn't line up as easily with the walking rhythm. That's why a sake cup rarely spills.
The sloshing barely fades, so it adds up with every step
Water is thin and runny, and has very little natural braking on its sloshing. Once the surface starts moving, it takes many back-and-forth swings before it settles.
So the next step arrives before the previous sloshing has died away. If the timing lines up, the new slosh piles on top of the old one. That's why the first few steps are fine, but the fifth or sixth step suddenly sends it over the edge.
Studies on the rhythms of cups and liquids suggest that the acceleration at the start of a walk is the biggest trigger for sloshing. They also report that walking faster while not looking at the cup increases the fine jitter in your hand, making spills more likely.
Experiments have confirmed that a layer of foam on top of a liquid makes the surface's sloshing settle much faster. This is thought to happen because the foam bubbles rub against each other and against the cup wall, draining energy from the slosh. The foam acts as a brake.
Reports suggest that holding the cup by gripping the rim from above with your fingers, rather than using the handle, transmits less of the sloshing motion. This is thought to be because the flex in your wrist softens the finer components of the walking motion. An experiment by the same researchers, showing that walking backwards spills less, won an "Ig Nobel Prize," an award for humorous scientific research.
So how should you carry it?
Once you understand the mechanism, the tricks for not spilling follow naturally.
- Don't fill it to the brim. A little headroom means the sloshing takes longer to build up to a spill.
- Start walking gently. The initial acceleration is the biggest trigger for sloshing.
- Watch the cup and walk slowly. Slowing your walk shifts your rhythm away from the surface's rhythm.
- Carry it in a narrower container. The surface's rhythm speeds up, making it less likely to line up with your walking rhythm.
In short
Coffee doesn't spill because your hand is shaking. It spills because the cup surface's favourite sloshing rhythm lines up with your walking rhythm, and the barely-fading sloshing builds up with every step.
It isn't your hand that's spilling the coffee —
it's the surface's rhythm and your footsteps falling into sync.
The same "push it at the right moment and it grows" mechanism is also the star of the show in bridges and buildings swaying in the wind and swings that go higher just from pumping your legs. For more on sloshing motion travelling across a surface, see also our article on circular ripples spreading across a pond.
- Fill a mug with water to about 80% full and gently shake it side to side on a table. Try slow, medium, and fast shaking — you'll find a speed where the surface suddenly starts sloshing much more.
- With the same amount of water, switch to a narrower glass and repeat. The speed at which it sloshes strongly should be faster than before.
- Finally, carry a mug of water and compare walking slowly while watching the cup versus walking normally while looking ahead — count which step the sloshing becomes noticeable in each case.
Try this with water somewhere the floor can get wet. Do not try this with hot drinks.
Want to know more? ― Terms, formulas, and links to textbooksWe flag which level each part belongs to, from middle-school science to university-level courses
- MSCovered in middle-school science
- HSCovered in high-school physics
- HS+Advanced high-school content, or textbook sidebar material
- UnivNot covered in high school — university-level fluid dynamics / vibration engineering
- ResearchNot yet settled "textbook fact" even at university — an active research question
MSTerms: this phenomenon has a name
- Sloshing: the back-and-forth motion of a liquid surface inside a container, driven by the container's own motion. It's also a problem for tanker trucks and large storage tanks.
- Natural frequency: the number of back-and-forth cycles per second at which something naturally likes to oscillate. This is what we called the "natural rhythm" in the text. Measured in hertz.
- Resonance: when the speed of an external shake is close to the natural frequency, even a small force can make the oscillation grow large.
MSHSCheck with a formula: how many times a second does a mug's surface slosh?
Let's estimate the most basic sloshing speed for a round cup with liquid deep enough. The effect of depth can be mostly ignored if the depth is sufficiently larger than the radius.
| Symbol g: gravitational acceleration (metres per second squared) | 9.8 |
| Symbol R: inner radius of the mug (metres) | 0.035 |
| Coefficient for a round container's most basic sloshing mode (said to come from a Bessel function) | 1.84 |
| Symbol f: formula for the natural frequency (hertz) | f = √(g × 1.84 ÷ R) ÷ (2π) |
| Multiply gravitational acceleration by the coefficient | 9.8 × 1.84 ≒ 18.0 |
| Divide by the radius | 18.0 ÷ 0.035 ≒ 514 |
| Take the square root (angular speed per second) | √514 ≒ 22.7 |
| Divide by the angle of one full turn | 22.7 ÷ 6.28 ≒ 3.6 |
| Compare: for a small cup with a 2 cm radius | 18.0 ÷ 0.02 = 900 |
| Take the square root | √900 = 30 |
| Divide by the angle of one full turn | 30 ÷ 6.28 ≒ 4.8 |
| Walking speed: 120 steps per minute, converted to per second | 120 ÷ 60 = 2 |
| The finer wobble at twice that | 2 × 2 = 4 |
The mug sloshes about 3.6 times a second, the small cup about 4.8 times. Since the walking-motion components cluster around 2 and 4 times a second, the numbers confirm that the mug lines up more closely.
HSHS+Simple harmonic motion and forced-oscillation resonance
HSThe back-and-forth motion of the surface is close to "simple harmonic motion," the same kind of motion as a weight hanging from a spring. Gravity pulls the tilted surface back level, it overshoots from momentum and tilts the other way, and this repeats. The stronger the restoring force (the narrower the container), the faster it swings back and forth.
HS+In "forced oscillation," where something is shaken periodically from outside, the closer the shaking frequency gets to the natural frequency, the larger the amplitude of the sloshing grows. The smaller the resistance damping the motion, the sharper and taller that peak becomes. Water has little resistance, so its peak tends to be sharp.
UnivThe natural frequency of sloshing in a cylindrical container
The sloshing of the liquid surface in a cylindrical container is determined by the condition that no liquid flows through the container wall, which fixes the frequency at the point where the derivative of a Bessel function equals zero. The value corresponding to the lowest asymmetric sloshing mode is about 1.84. If the liquid depth is H, the effect of depth enters as a hyperbolic-tangent factor, which becomes close to 1 once H is comparable to or larger than the radius. Meanwhile, the motion of a hand while walking contains components at the walking frequency and its integer multiples, plus irregular components, so the real sloshing is treated as a kind of stochastic forced oscillation.
ResearchWhat's still not fully understood
- How to account for individual differences in walking style. Walking speed and arm swing vary from person to person, and which component of hand motion actually drives the sloshing depends on the conditions — the conclusion changes case by case.
- Predicting how strongly foam damps the sloshing. The effect is thought to depend on bubble size and foam-layer thickness, and there is no established way yet to predict it accurately for a given drink.
- The effect of different grips. There are reports that gripping the rim from above, or walking backwards, reduces spilling, but the experiments involved small numbers of participants, and how far the findings generalise is still under discussion.
In other words, this article too describes things "as currently understood." The framework of natural rhythm and resonance is solid, but the combination with something as variable as human walking is still an active area of research.
Links to textbooks (by level)
| Level | Subject / unit | Where in this article |
|---|---|---|
| MS | Science: frequency of sound (cycles per second) | Comparing things by how many times a second they oscillate |
| HS | Physics: simple harmonic motion and waves | The back-and-forth motion of the surface, and why width changes its speed |
| HS+ | Physics: forced oscillation and resonance | The peak graph in Figure 1, and why the sloshing builds up with each step |
| Univ | Fluid dynamics / vibration engineering | Sloshing in cylindrical containers and Bessel functions |
| Research | Biomechanics / physics of foam | Individual differences in walking, how foam damps sloshing |
| ― | Everyday connections | How to carry drinks, sloshing countermeasures for tanker trucks and reservoirs |
- H. C. Mayer, R. Krechetnikov, "Walking with coffee: Why does it spill?", Physical Review E 85, 046117 (2012)
- A. Sauret et al., "Damping of liquid sloshing by foams", Physics of Fluids 27, 022103 (2015)
- J. Han, "A Study on the Coffee Spilling Phenomena in the Low Impulse Regime", Achievements in the Life Sciences 10 (2016)
- Improbable Research, list of Ig Nobel Prize winners (2017 Fluid Dynamics Prize)
- R. A. Ibrahim, "Liquid Sloshing Dynamics: Theory and Applications", Cambridge University Press (2005)
※This article is a general-audience science explainer. The figures given are rough approximations meant to help illustrate the mechanism. When carrying hot drinks, please be careful that any spill doesn't land on anyone nearby.