MemeLab — a contagion simulator in your browser

MemeLab is a free, deterministic epidemic simulator that runs entirely in your browser: a SEIR cellular automaton where every cell is one person and every tick is one day. I built it so you can watch outbreaks spread, evolve strains, switch defenses on and off, and fit R₀ to real outbreak curves — on a CPU, WebAssembly or WebGPU engine.

The simulator needs JavaScript. Enable it and reload to run it; the text below describes what it does.

What you can simulate

Three engines

The same model runs on three backends. The plain CPU engine works in any modern browser. The WebAssembly engine is a faster drop-in for the same step. The WebGPU engine moves the transmission pass onto your graphics card for large grids; it needs a browser with WebGPU enabled and a real hardware adapter — software renderers are treated as unavailable. If a backend can't start, the simulator falls back to the CPU engine automatically and tells you why.

Questions I get asked

Is it free?

Yes. There is no account, no paywall and no in-app purchase. The simulation runs on your machine.

Does it run offline?

Mostly. Once the page has loaded, the simulator makes no network requests — all computation happens locally. It isn't installed as an offline app, though, so you still need a connection to load it the first time.

Is it deterministic?

Yes. Every run is driven by a seeded pseudo-random generator, and the permalink encodes the seed along with the grid size, disease genes, defenses, theme and speed. Anyone opening that link replays the same run.

Is it a real epidemiological model? How accurate is it?

It is a real SEIR compartment model expressed as a stochastic cellular automaton, with R₀ computed analytically from the strain's parameters and an effective R measured from the run. It is built for intuition and teaching, not forecasting: the population is a lattice of identical people with local contacts, and the bundled outbreak datasets are sparse and illustrative. Treat the numbers as qualitative.

How is it different from an agent-based model?

It is close to one. Each cell is an individual with its own state, strain and defense flags, so it is agent-based in that sense — but agents don't move and don't have schedules or heterogeneous behaviour. Contact structure comes from the lattice geometry (or the mean-field mode, which approximates a classic well-mixed ODE model). That keeps it fast, deterministic and easy to reason about.

From the blog

I write about outbreaks, memetics and the engineering behind MemeLab. Read the blog.