Conway’s Game of Life is a cellular automaton where a handful of simple rules give rise to complex, often mesmerising patterns. This is a small, self-contained build of it: a single HTML file with inline CSS and vanilla JavaScript, nothing to install or build.
The simulation runs full-screen on an HTML canvas, automatically sizing its grid to fit the browser window and resizing live if the window changes. Cells are seeded randomly and evolve generation by generation:
- A live cell with 2 or 3 live neighbours survives.
- A dead cell with exactly 3 live neighbours becomes alive.
- All other cells die or stay dead.
If the board settles into a still life, a short repeating oscillator, or dies out entirely, it is automatically reseeded with a fresh random pattern after a short patience period, so the display keeps evolving indefinitely without manual intervention.
Responsive canvas
Fills the viewport at any screen size, with adjustable cell size from 2 to 40px.
Auto-restart on stagnation
Detects still lifes, short cycles, and dead boards via a rolling board hash, then reseeds after a configurable patience window.
Playback controls
Play/pause, single-step, randomize, and clear, with an auto-hiding control bar that stays out of the way.
Configurable settings
Generation speed, starting density, toroidal or dead edges, several colour themes including an age-based heatmap, grid lines, and fading trails.
Interactive drawing
Click or drag on the canvas to toggle cells by hand and seed your own patterns alongside the random ones.
Keyboard shortcuts
| Key | Action |
|---|---|
Space | Play / pause |
R | Randomize |
C | Clear |
S | Step |
F | Fullscreen |
Conway’s Game of Life is free to use, runs entirely in your browser, and sends nothing to any server.