Langton's Ant Generator

Set loose the two-rule ant -- order, then chaos, then the endless highway -- on a blank board or a random soup, with your own cells drawn in whenever you like.

What is Langton's Ant?

Langton's Ant is a cellular automaton invented by Chris Langton in 1986: an ant walks a grid of black and white cells, turning right on white and left on black, flipping each cell's color as it leaves. Those two rules produce three famous acts: near-symmetric patterns at first, then over ten thousand steps of apparent chaos, and finally the 'highway' -- an endless diagonal ladder the ant builds forever, 104 steps per rung. Nobody has proved the highway must appear from every starting pattern, though it always has; the question remains open mathematics. Like Conway's Game of Life, it is a tiny machine demonstrating that utterly simple rules can generate behavior nobody could predict by reading them.

About this generator

A live Langton's Ant board: press Generate and one, two, or four ants start walking, painting and unpainting cells under the two-rule law. Start them on a blank board to watch the classic arc -- order, chaos, then the highway -- or on a random soup to derail it; draw your own cells at any time, even mid-run, and see the ants cope.

Every result here is drawn using crypto.getRandomValues() -- the Web Crypto API's cryptographically secure randomness -- instead of Math.random(), so it's genuinely unpredictable, not just statistically random. Learn more.

What people use it for

Like the Game of Life next door, it's a watch-and-wonder machine and a classroom demonstration of emergence -- with the added drama of a genuinely unsolved question playing out on screen. Multiple ants are the sandbox mode: watch two of them build, wreck, and rebuild each other's work.

How it works

The board is a 96×72 grid whose edges wrap around. Every step, each ant checks its cell: on an unpainted cell it turns right, on a painted one it turns left; either way it flips the cell and walks forward -- the complete rulebook. Ant headings (and the soup, when chosen) come from the site's cryptographically secure randomness. Speeds run from watchable single steps to 240 steps per tick, because the famous highway only emerges after roughly ten thousand.

Common questions

What am I waiting for?

The highway. A lone ant on a blank board makes symmetric shapes, descends into ~10,000 steps of chaos, then abruptly starts building a diagonal ladder it will extend forever. Run it on Fast and it arrives in under a minute.

What happens with more than one ant?

They share the board and constantly repaint each other's trail, which can delay the highway indefinitely or produce joint structures no single ant makes -- that's why 2 and 4 ants are offered.

Can I interfere?

Yes -- click or drag on the board to paint or erase cells while it runs. A single painted cell in an ant's path reroutes its entire future.

Does the highway always appear?

From every starting pattern ever tried, yes -- but nobody has proved it must. It's a genuinely open mathematical question, running live on your screen.

Related Generators

Coat of Arms · Mandala · Maze · Game of Life · Fractal · Walk Art

All Pattern generators

Browse all generators