Run Conway's Game of Life in your browser on a wrapping grid. Glider gun, pulsar, R-pentomino and acorn presets, adjustable speed, and editable source.
Knobs patch the running animation live. A few (marked in the code as baked-in values like particle counts) restart the preview.
Conway's B3/S23 on a wrapping grid. Drag to draw your own cells.
Your code runs in a sandboxed frame with no access to this page, and it is never sent to a server. three.js demos load the library from jsDelivr; the rest need nothing but the browser.
A live, editable implementation of Conway’s Game of Life running on a wrapping grid in your browser. Load a starting pattern, set the generation rate, and watch the automaton run — or drag on the canvas to draw your own cells into a running field and see how far the disturbance travels. The JavaScript that produces it is on the page in an editor, so you can change the rule itself and watch a different universe appear.
The Game of Life is not a game and has no players. It is a two-dimensional cellular automaton devised by John Conway in 1970, and it is the standard example of how a rule small enough to write on one line produces behaviour rich enough to be Turing complete.
Every cell is alive or dead. Each generation, every cell counts its eight neighbours — orthogonal and diagonal — and applies one rule:
In code that is a single expression:
next[i] = (n === 3 || (n === 2 && grid[i])) ? 1 : 0;
The shorthand B3/S23 means “born on 3, survives on 2 or 3”. The notation exists because the same machinery runs any rule you care to name: B36/S23 is HighLife, which has a self-replicating pattern; B1/S1 produces fractal replicators; B5678/S45678 is a majority-vote rule that forms blobs. Change two characters in the editor and you are simulating a different universe.
Two implementation details are not optional, and both are common bugs in first attempts:
| Pattern | What it is | What to watch |
|---|---|---|
| Random soup | A random field at your chosen density | Most of it dies within about 20 generations; what remains is almost entirely blocks, beehives, blinkers and gliders |
| Gosper glider gun | The first known pattern with unbounded growth | Fires a glider every 30 generations, forever. Slow the rate right down to see the collision on the left that produces each one |
| Pulsar | A period-3 oscillator | The best correctness test there is — an off-by-one in the neighbour count usually kills it within a generation or two |
| R-pentomino | Five cells | Churns chaotically for 1,103 generations before settling. Five cells, a thousand generations of unpredictable behaviour |
| Acorn | Seven cells | 5,206 generations, and it spreads across a far larger area than seems possible |
The vocabulary that emerges from a random soup is worth naming, because it is the same in every run. Still lifes never change: the block (2×2), the beehive, the loaf, the boat. Oscillators repeat with a fixed period: the blinker (three in a row, period 2), the toad (period 2), the pulsar (period 3). Spaceships translate across the grid: the glider moves one cell diagonally every four generations, and the lightweight spaceship moves horizontally. Gliders matter beyond aesthetics — they are the signal wires in Life-based computers, and the gun that emits them is what proved unbounded growth possible, settling Conway’s original open problem.
The simulator is a live JavaScript canvas sandbox: the source is editable on the page, changes run immediately, and you can download the whole thing as a single self-contained HTML file to keep or modify offline.
Life is Turing complete. Anything a computer can compute can be computed by an initial arrangement of cells — people have built logic gates from glider collisions, memory from oscillators, and a working universal Turing machine, plus a pattern that simulates Life itself. That result is the sharpest available illustration of emergence: the rule contains no notion of a glider, a gun or a computer, yet all of them exist as consequences of it. The same idea underpins reaction-diffusion models of animal markings, lattice-gas approaches to fluid dynamics, and agent-based modelling in general.
A dead cell with exactly three live neighbours becomes alive; a live cell with two or three live neighbours survives; everything else dies or stays dead. Written as B3/S23.
So every cell has exactly eight neighbours and no edge case is needed. The topology is a torus. A bounded grid with dead edges is also valid, but patterns then die when they reach the wall, which changes long-run behaviour.
A five-cell pattern that reproduces itself one cell diagonally every four generations, so it appears to travel across the grid. It is the smallest and most common spaceship, and gliders serve as signals in Life-based logic circuits.
A pattern discovered by Bill Gosper in 1970 that emits a glider every 30 generations indefinitely. It was the first known pattern of unbounded growth and won Conway’s $50 prize for settling that question.
Almost always one of two things: updating the grid in place instead of writing to a second buffer, or mishandling the edges so cells near the boundary get the wrong neighbour count. Load the pulsar — if it does not oscillate with period 3, one of those two is the cause.
A pattern that never changes because every live cell has exactly two or three live neighbours and no dead cell has exactly three. The block, beehive, loaf and boat are the common ones, and a settled random soup is mostly made of them.
Yes — the JavaScript is editable on the page. Change the birth and survival conditions and you get a different automaton: B36/S23 is HighLife, B34/S34 is 34 Life, B2/S is Seeds.
Yes. The playground exports the running demo as a single self-contained HTML file you can open offline or edit further.
The Game of Life is one demo in our JavaScript animation playground, alongside the sorting algorithm visualizer, which animates five sorts implemented as generators, and the Mandelbrot explorer for a different kind of emergent structure from a one-line rule.
Conway's Game of Life runs on B3/S23. A dead cell with exactly three live neighbours is born. A live cell with two or three live neighbours survives. Every other cell dies, from loneliness below two or overcrowding above three.
That is the entire specification. Everything else - gliders, oscillators, guns, and patterns that run for thousands of generations before settling - is a consequence of those two clauses applied to every cell at once.
Gosper glider gun was the first known pattern to grow without bound, producing a new glider every thirty generations. Its discovery in 1970 answered an open question and won a fifty dollar prize.
Pulsar is a period-three oscillator, one of the most common naturally occurring patterns in random soups.
R-pentomino is five cells that take over a thousand generations to stabilise, scattering gliders as it goes. It is the standard illustration that a trivial starting state can have an outcome nobody can work out except by running it.
Acorn is seven cells that run for more than five thousand generations. If you want to see why the Game of Life is described as unpredictable rather than merely complicated, start here and leave it running.
Conway's original B3/S23: a dead cell with exactly three live neighbours is born, and a live cell survives with two or three live neighbours. Everything else dies.
A random soup with adjustable density, the Gosper glider gun, a pulsar, the R-pentomino and the acorn. The last two are famous for producing very long-lived chaotic growth from a handful of cells.
Yes. Drag on the grid to toggle cells while the simulation runs or is paused.
Yes. The edges are joined, so a glider leaving the right side reappears on the left. That keeps long-running patterns from dying at a boundary.
Five cells that take more than a thousand generations to stabilise. It is the standard demonstration that a trivial starting position can have an outcome nobody can predict without simply running it.
No. It is a zero-player cellular automaton: you set the initial state and the rules do the rest. It is Turing complete, which means any computation can in principle be built out of its patterns.