Sandpile: the website that grows and avalanches forever
31 Oct 2026 · By the Boring Websites editors
Sandpile is a single web page that drops imaginary grains of sand onto a grid and lets them collapse. It looks like a slow screensaver. It is actually a live run of the Bak-Tang-Wiesenfeld abelian sandpile, one of the most studied toy models in physics, and the same object that just helped win its mathematician a major medal.
The page states its own purpose plainly: a live Bak-Tang-Wiesenfeld abelian sandpile that grows and avalanches forever. There is no score, no goal, and no way to win. Grains accumulate, towers reach a tipping point, and the collapse ripples outward. Then it happens again, with no two avalanches quite alike.
In brief
- Sandpile runs an abelian sandpile cellular automaton live in the browser, with grains piling up and toppling in endless avalanches.
- The rule is trivial: a cell holding four or more grains gives one grain to each of its four neighbours. All the complexity is emergent.
- The model is the original 1987 example of self-organized criticality, the idea that systems can tune themselves to a knife-edge without anyone adjusting a dial.
- Deepak Dhar, who proved the model's defining property in 1990, shares the 2026 Dirac Medal for exactly this line of work.
What the page actually shows
Open the site and a field fills with coloured cells. Each colour marks how many grains a cell currently holds. Keep watching and a quiet rhythm emerges: a slow build, then a sudden cascade as a cluster of overloaded cells hands off its grains all at once.
The texture is the real draw. At rest the grid settles into a mottled patchwork, and during an avalanche a wave of colour sweeps across it as cell after cell discharges. The eye reads it as something alive, even though every pixel is following one rigid arithmetic rule with no randomness beyond where grains land.
The controls are minimal by design. Moving the pointer steers where new grains land, a click dumps a batch at once, and the spacebar pauses the whole thing. A small counter tracks the number of grains added and the time elapsed. That is the entire interface.
The page is honest about its limits too. The simulation is not saved anywhere, so reloading the tab ends the current pile and starts a fresh one. Nothing about the run is stored or sent off. What a visitor watches is computed on the spot, in their own browser, and then forgotten.
Sandpile is made by the Boring Websites team, the same group behind a small constellation of single-purpose pages. The source code is public, and the footer links out to the project's blog and its various social accounts. It belongs to the same family as the rest of the Boring Websites network, a set of sites that each do exactly one strange thing well.
The rule is almost insultingly simple
The sandpile model lives on a grid. Every cell holds a whole number of grains. The only rule concerns what happens when a cell gets too tall.
On the standard two-dimensional square grid, a cell becomes unstable the moment it holds four or more grains. According to the reference description of the model, an unstable cell then topples: it loses four grains and sends one to each of its four immediate neighbours, up, down, left, and right.
That single handoff is where avalanches come from. A toppling cell can push one of its neighbours up to four grains, which makes that neighbour topple, which pushes a further neighbour over the edge. One grain, dropped in the right place, can set off a chain of topplings that races across a large region before everything settles back below four.
Grains that fall off the outer edge of the grid simply vanish. That leak is important. It is the escape valve that lets the pile reach a stable state at all, rather than filling up without end. Without an edge to drain into, the grid would just saturate.
The process is also fully deterministic. Given a starting grid and a place to drop the next grain, the outcome is fixed. The only unpredictability a visitor adds is where they choose to aim. Everything after that, including which avalanches turn out large, is settled by the rule alone.
Why the number four matters
Four is not arbitrary. It is the number of neighbours each interior cell has on a square grid, so a toppling cell can give exactly one grain to each and empty the surplus evenly. Change the grid, and the threshold changes with it. The model generalizes to any network, where a cell topples once it holds at least as many grains as it has connections.
Why physicists care: self-organized criticality
The sandpile is not just a pretty cascade. It was built to illustrate an idea, and that idea is self-organized criticality.
In 1987 Per Bak, Chao Tang, and Kurt Wiesenfeld published a short paper in Physical Review Letters titled Self-organized criticality: An explanation of 1/f noise. In it they introduced the sandpile as the first clean example of a system that drives itself to a critical state. It became one of the most cited physics papers of its era.
The key move is subtle. In ordinary physics, a system only sits at a critical point if someone carefully tunes a parameter such as temperature to an exact value. The sandpile needs no such tuning. Feed it grains at random and it finds the critical state on its own, then stays there.
At that critical state the pile has no favourite scale. Most new grains do nothing, or trigger a tiny shuffle. A few set off medium cascades. Very occasionally, one grain brings down a vast swathe of the grid. The sizes of these avalanches follow a power law, which is a fancy way of saying there is no typical avalanche to expect.
The mechanism depends on a separation of speeds. Grains are added slowly, one at a time, while avalanches resolve almost instantly once they start. That gap between a patient drive and a rapid release is what lets the pile sit poised at the edge of instability rather than smoothing itself out. Many natural systems that show the same statistics share that same lopsided pairing of slow loading and sudden failure.
Bak argued that the same signature appears across nature. His 1996 book How Nature Works pressed the case that earthquakes, forest fires, extinctions, and traffic jams all share this pattern of long calm punctuated by bursts of every size. The sandpile is the simplest cartoon of that behaviour, which is why it keeps turning up in lectures.
Watching Sandpile makes the abstraction concrete. The long stretches where little happens are the calm. The sudden sweeping collapses are the rare large events. Nobody schedules them, and nobody can predict exactly when the next big one will arrive, which is precisely the point the physicists were trying to make.
Where the same pattern shows up in the wild
The reason the sandpile earned so much attention is that its fingerprint, calm interrupted by bursts of every size, appears far beyond any grid of pretend sand.
Earthquakes are the stock example. The Gutenberg-Richter law holds that small quakes are common and large ones rare, following a power law with no characteristic size, which is the same statistics an avalanching sandpile produces. That resemblance is why fault systems are sometimes described as sitting near a self-organized critical state.
The original 1987 paper framed the model as an explanation for 1/f noise, the faint flickering signal found in everything from electronic components to the brightness of stars. Bak and his co-authors argued that self-organized criticality could be a general mechanism behind such scale-free noise.
The same framework has since been stretched, with varying success, over forest fires, financial crashes, species extinctions, and bursts of firing in networks of neurons. Not every claim has held up, but the humble sandpile remains the reference picture researchers reach for first.
The abelian trick that made it math
There is a second name attached to the model, and it is the reason mathematicians can say anything precise about it at all.
When several cells are unstable at once, there is a choice: which one topples first? The avalanche could in principle play out in many different orders. In 1990 Deepak Dhar proved something that sounds too good to be true. The final stable configuration, once the dust settles, does not depend on the order in which the topplings happen.
More than that, as the model's formal treatment records, every cell topples the same number of times regardless of the sequence chosen. Dhar called the model abelian, borrowing the term from group theory for operations whose order does not matter. The name abelian sandpile stuck.
This property is what turns a chaotic-looking cascade into something tractable. Because order does not matter, the stable configurations form a neat mathematical structure. The recurrent states, the ones the pile keeps returning to, combine under grain-addition into a group, complete with an identity element that behaves like a well-behaved zero.
That identity element is itself a minor celebrity. For many grids it is a strikingly intricate fractal pattern, printed on posters and studied for its own sake. A rule a child could follow produces a stable state that looks designed. None of it is designed. It falls out of the arithmetic.
Counting the stable states
The abelian structure also yields a startling bookkeeping fact. The number of recurrent configurations a grid can settle into equals the number of spanning trees of that grid, a quantity drawn from pure graph theory. Two problems that look unrelated turn out to be counting exactly the same thing.
This is the sort of bridge mathematicians prize. A messy dynamical process about toppling sand is secretly the same object as a tidy combinatorial question about trees. The sandpile keeps earning its keep precisely because it quietly connects fields that rarely speak to each other.
A 2026 medal for a pile of sand
The sandpile is not a historical curiosity gathering dust. The work around it is still being honoured at the highest level.
In 2026 the International Centre for Theoretical Physics in Trieste awarded its Dirac Medal to Deepak Dhar, alongside the statistical physicists Bernard Derrida, Marc Mezard, and Haim Sompolinsky. The Dirac Medal is one of the most prestigious honours in theoretical physics, and the citation points directly at the sandpile.
The committee described Dhar's achievement in plain language that could double as a caption for the website: as grains are added to a sandpile, most cause no change or only small avalanches, while occasionally a single grain can cause a much larger collapse. That is the behaviour a visitor to Sandpile watches unfold in real time.
Dhar is only the second Indian scientist to receive the Dirac Medal, after the string theorist Ashoke Sen in 2012. According to his biography, he is also among a tiny group of researchers to hold both the Boltzmann Medal, which he won in 2022, and the Dirac Medal. A toy about falling sand turns out to have serious academic company.
The claim that drew a fight
Self-organized criticality arrived with grand ambitions, and not everyone was convinced.
Critics argued the idea was applied too loosely, and that labelling any power law as evidence of self-organized criticality explained less than it seemed to. Real earthquakes and real brains are far messier than a square grid quietly draining grains off its edges.
The sandpile survived the argument by being honest about what it is. It is a minimal model, not a theory of everything. It proves that simple local rules can generate scale-free avalanches with no tuning at all. Whether a given natural system truly works the same way is a separate question, to be settled case by case rather than by analogy.
How to actually watch it
Sandpile rewards a particular kind of attention, which is to say very little. The best approach is to open it, stop trying to steer, and let it run.
Dropping grains in one spot builds a tall unstable column that eventually releases in a dramatic sweep. Spreading grains around with the pointer produces a more even simmer of small events. Pausing with the spacebar freezes a single frame, which is the easiest way to see the patchwork of grain counts the colours encode.
There is no correct way to use it and nothing to achieve. That restraint is the house style. Like the other pages in the network, from the geological patience of Boring Websites outward, it offers one well-made idea and then gets out of the way. The reward is noticing the rhythm, not reaching an end.
It also makes an unusually good demonstration tool. Anyone trying to explain avalanches, power laws, or the phrase self-organized criticality to a sceptical friend can simply share the tab and point. The model that filled chalkboards for decades now fits in a browser window, running quietly until the next big collapse.
A browser turns out to be the natural home for it. There is nothing to install, no account to make, and no settings to wade through. The same code that a researcher might run in a notebook simply runs on the page, which means a decades-old physics result is one link away from anyone curious enough to click. The barrier between a famous model and a casual onlooker has rarely been this thin.
FAQ
Is Sandpile a game?
No. There is no objective, score, or ending. It is a live visualization of a mathematical model. A visitor can nudge where grains land, but the point is to observe the avalanches rather than to win anything.
What is the actual rule being simulated?
On a square grid, any cell holding four or more grains topples, losing four grains and giving one to each of its four neighbours. Grains that reach the outer edge fall off. Everything else, including every avalanche, emerges from repeating that one step.
Why is it called abelian?
Deepak Dhar showed in 1990 that the final stable pile is the same no matter what order the unstable cells topple in. Operations whose order does not matter are called abelian in mathematics, so the model inherited the name.
Does it save my pile?
No. The simulation runs entirely in the browser and keeps nothing. Reloading the page ends the current run and begins a new one from scratch, and nothing about the pile is stored or sent anywhere.