Sandpile Avalanches
The Abelian sandpile: topple 2ⁿ grains into a symmetric fractal, or count avalanches of every size.
- 0 grains
- 1 grain
- 2 grains
- 3 grains
- 4 or more, toppling
Press and hold anywhere to pour in grains, an event in time that Restart leaves out. Every cell holding four grains topples, passing one grain to each neighbor, which can make them topple too. Pile 2ⁿ grains in the center to grow the fractal, or drop grains and count avalanches of every size.
How is Sandpile Avalanches working for you?
About Sandpile Avalanches
Good for: Short breaks
Sandpile Avalanches is a live Abelian sandpile, the model Per Bak, Chao Tang and Kurt Wiesenfeld used in 1987 to introduce self-organized criticality. Grains of sand are added to a grid. Any cell that holds four or more grains topples, sending one grain to each of its four neighbors; grains pushed off the edge are lost. A single new grain can set off a chain reaction — an avalanche — that ripples across the pile.
Pile 2ⁿ grains on the center cell and let them topple, and the sand spreads into a symmetric fractal of nested triangles and patches, each cell colored by how many grains (0 to 3) it holds. Deepak Dhar showed the model is 'Abelian': the final pattern does not depend on the order of the topplings, which is why this tool can topple huge piles in bulk and still get the exact answer.
Switch to random drops and the pile settles into a critical state where avalanches of every size occur — most topple a cell or two, but a few sweep the whole grid — and the log-log histogram of avalanche sizes falls along a straight line, a power law. Drip grains at the center, drop them wherever you click, choose a palette and export a crisp high-resolution PNG of the fractal.
How to use Sandpile Avalanches
- Pick a start. Pile of 2ⁿ grains builds the fractal; Drip at the center adds grains one by one at the middle; Random drops sprinkles grains everywhere; Drop where you click lets you pour sand with your pointer.
- Grow the fractal. In Pile mode, choose how many grains to start with (2⁸ up to 2²⁰ ≈ one million) and press Play. Bigger piles take longer to settle but reveal more detail.
- Watch avalanches. In Random drops mode, the Avalanche sizes chart counts how many grains toppled in each avalanche, on log-log axes, with the fitted power-law slope.
- Pour by hand. Press and hold anywhere on the table to pour grains under your pointer in any mode, and drag to move the stream. In Pile mode, the fractal has to finish settling first.
- Control the flow. Drop rate sets how fast sand is added in the drip, random and cursor starts, in grains per second; Grid sets the size of the table, and Seed fixes the random drops, so a link replays the same avalanches. Restart starts the same pile again; Reset also returns every setting to its default.
- Export. Download a pixel-perfect PNG up to 4000 px, record the whole settling of a pile as a video or GIF, or save the avalanche sizes as CSV.
Frequently asked questions
What is the Abelian sandpile model?
It is a cellular automaton in which each cell holds some grains. A cell with four or more grains topples, giving one grain to each neighbor. 'Abelian' means the order of topplings doesn't matter: however you process them, you end with the same stable pile, as Deepak Dhar proved in 1990.
Why does the 2ⁿ pile make a fractal?
Toppling spreads grains outward in waves that interfere with each other. The final stable pattern has self-similar structure at many scales — triangles inside triangles and patches with periodic patterns — and its shape converges to a fixed limit as the number of grains grows, a phenomenon mathematicians such as Lionel Levine and Wesley Pegden have studied in detail.
What is self-organized criticality?
Many systems drive themselves to a critical point where small causes can have effects of any size. In the sandpile, adding grains slowly builds the pile up to the edge of instability; after that, avalanches of all sizes happen, and their sizes follow a power law. Earthquakes, forest fires and solar flares have been compared to this behavior.
What do the colors mean?
Each color shows how many grains a cell holds once the pile is stable: 0, 1, 2 or 3. Cells briefly shown in white hold four or more grains and are about to topple.
Can I leave it running at night?
Yes. Choose Avalanches mode and a low Grains per frame: grains drop one at a time and set off avalanches of every size for as long as it runs. Press Full screen and lower the screen brightness; it makes no sound.
References
- Bak, P., Tang, C., & Wiesenfeld, K. (1987). Self-organized criticality: An explanation of the 1/f noise. Physical Review Letters 59(4), 381–384.
- Dhar, D. (1990). Self-organized critical state of sandpile automaton models. Physical Review Letters 64(14), 1613–1616.





