Boids

Run a boids flocking simulation and print the paths it draws. Each boid steers by three rules from Craig Reynolds’s 1987 model: keep apart from boids that are too close (separation), turn towards the average heading of its neighbours (alignment) and move towards their average position (cohesion). Set up to 600 boids in a box that wraps round or has walls, the radius and weight of each rule, the top speed and the top steering force, the start and the seed, and up to 2,000 steps. Press Play to watch the same run move, or go straight to the print: every boid’s path is drawn as a line, coloured by time, heading or speed. The tool reports how well the headings match at the end and how many separate groups there are. Download a PDF, a 300 DPI PNG or an SVG. Nothing is uploaded.

100% private — everything runs in your browser. Everything runs in your browser; nothing is uploaded.

100% private — runs in your browser

Print at 100% (Actual size). Real size prints on one sheet when the drawing fits; the check bar in the footer lets you confirm the scale. The SVG holds the drawing at the printed size.

Flock

Rules

Trails

Page

Runs in your browser with our own code: nothing you type is uploaded or saved. Every step of every boid is worked out by our own code from the rules and the seed shown. You may use what you make here, including commercially, with no credit needed.

How to run and print a boids simulation

  1. Pick a preset, or set the number of boids and the box.
  2. Set the radius and weight of separation, alignment and cohesion, the top speed and the top steering force.
  3. Choose the start, the seed and the number of steps, and wait for the preview; press Play to watch it move.
  4. Choose how to colour the trails and the line width; choose Fitted to one page or Real size and the paper.
  5. Download the PDF and print at 100% (Actual size), or the PNG or SVG.

What you can use it for

  • Generative art posters and prints of flocking paths
  • Plotter, laser and vinyl art from the trail SVG
  • Lessons on emergent behaviour and simple rules in computing and maths
  • Trying how each rule changes the flock, one at a time
  • Backgrounds and textures for design work
  • A repeatable start for coding your own boids (same seed, same run)

The 14 presets

PresetBoidsBoxEdgesWeights (sep / ali / coh)RadiiStepsStartHeading matchGroupsShowsTrail pointsColour by
Partly aligned: 200 boids, separation 1.5, alignment 1, cohesion 1, 400 steps200300 × 200wrap round1.5 / 1 / 16 / 20 / 30400random0.7931partly aligned41,141time
Partly aligned: 600 boids, 300 steps (the most boids)600300 × 200wrap round1.5 / 1 / 16 / 20 / 30300random0.5613partly aligned48,414time
Aligned flocks: 150 boids all starting to the right150300 × 200wrap round1.5 / 1 / 16 / 20 / 30400one heading0.9934aligned30,870time
Partly aligned: 150 boids starting in the middle150300 × 200wrap round1.5 / 1 / 16 / 20 / 30400bunched0.5682partly aligned31,338heading
Aligned flocks: 250 boids coloured by heading250300 × 200wrap round1.5 / 1 / 16 / 20 / 30400random0.9832aligned53,325heading
Partly aligned: 200 boids in a box with walls200300 × 200walls1.5 / 1 / 16 / 20 / 30400random0.8772partly aligned41,200time
Unaligned: 200 boids with no alignment (separation and cohesion only)200300 × 200wrap round1.5 / 0 / 16 / 20 / 30400random0.1277unaligned41,181time
Unaligned: 200 boids with separation only200300 × 200wrap round1.5 / 0 / 06 / 20 / 30400random0.0621unaligned41,176time
Unaligned: 120 boids with every rule off (straight lines)120300 × 200wrap round0 / 0 / 06 / 20 / 30300random0.1011unaligned18,115one colour
Partly aligned: 200 boids, cohesion 2, small separation radius200300 × 200wrap round1.5 / 1 / 24 / 20 / 30400random0.7563partly aligned43,443heading
Aligned flocks: 200 boids, wide view (alignment radius 40)200300 × 200wrap round1.5 / 1 / 16 / 40 / 50400random0.9961aligned41,180time
Aligned flocks: 80 boids, 2,000 steps80300 × 200wrap round1.5 / 1 / 16 / 20 / 302,000random0.9951aligned32,014one colour
Aligned flocks: 200 boids, gentle turns (max force 0.02), coloured by speed200300 × 200wrap round1.5 / 1 / 16 / 20 / 30400random0.9504aligned43,266speed
Aligned flocks at real size: 100 boids in 150 × 100 units at 1 mm per unit100150 × 100wrap round1.5 / 1 / 15 / 15 / 22400random0.9951aligned20,561time

Every value after Start is worked out by the tool at the last step. Top speed 2 and top steering force 0.05 unless the preset says otherwise.

Checks

CheckResult in our tests
One boid, no neighboursstraight line at constant speed 2 for 500 steps
Two boids 3 apart, separation onlygap 3, 3.1, 3.3, 3.6, 4, 4.5 … (grows every step)
150 boids all one heading, alignment onlyevery velocity unchanged after 300 steps
Same seed twicethe same trails, bit for bit
400 boids × 2,000 stepsno invalid number; every speed at most the top speed
Second stepper of our ownagrees to 1e−6 over 150 steps, wrap round and walls

What prints

DownloadWhat is in it
PDFThe box and every trail fitted to one page or at real size, vector, with the settings, the heading match, the groups and a check bar
PNG 300 DPIThe same sheet as a picture
SVGThe trails at the printed size, one stroked path per colour band, and the box

For a cutter that needs DXF, use SVG to DXF.

Which tool to use

You wantUse
Paths of a flocking simulationBoids (this page)
Networks grown by trail-following agentsPhysarum
Cells split by nearest pointsVoronoi Generator
Random noise texturesNoise Texture Generator
Self-similar shapesFractal Generator

Other tools: the Voronoi Generator splits a page into cells, the Noise Texture Generator makes noise textures and the Fractal Generator draws fractals.

More free tools

Patterns, textures and printables?

Drawing and print tools that run privately in your browser, with no sign-up and no watermark.

See all free tools →

Frequently asked questions

What are boids?

Simulated flocking agents. The Wikipedia article on boids (read 13 November 2026) says Craig Reynolds developed the program in 1986 and described it in the 1987 paper “Flocks, herds and schools: A distributed behavioral model” at the 14th annual ACM SIGGRAPH conference. Each boid follows three local rules, and the flock comes from those rules alone.

What are the three rules?

Separation: steer away from boids closer than the separation radius, more strongly the closer they are (each one pushes by its offset divided by the distance squared). Alignment: steer towards the average velocity of boids within the alignment radius. Cohesion: steer towards the average position of boids within the cohesion radius. Each rule becomes a steering force: the direction it points at full top speed, minus the boid’s velocity, shortened to the top steering force. The three are multiplied by their weights and added.

How does one step work?

Every boid works out its three forces from where everyone was at the start of the step, then all boids move at once: the velocity gets the forces added and is shortened to the top speed if needed, and the position moves by the velocity (one time unit per step). A boid with no neighbours keeps going straight at the same speed: our tests run a lone boid for 500 steps and it never turns or changes speed.

Do two close boids really move apart?

Yes. In our tests two boids 3 units apart with separation alone (radius 6) move apart every step while they are closer than 6: their gap in the first steps is 3, 3.1, 3.3, 3.6, 4, 4.5 units, worked out by the tool.

What are wrap round and walls?

Wrap round joins the opposite edges, so a boid that leaves on the right comes back on the left, and neighbours are found across the edges too; its trail is broken where it jumps. Walls keep every boid inside: a boid that would cross an edge is mirrored back and that part of its speed reverses. Both are tested to keep every boid in the box.

What does heading match mean?

The length of the sum of all velocities divided by the sum of all speeds: 1 means every boid is heading the same way, values near 0 mean the headings cancel out. The presets are named by this number at the last step: aligned at 0.9 or more, partly aligned from 0.5, unaligned below. Groups counts the separate clusters of boids closer than the cohesion radius (across the edges when they wrap).

What do the trail colours show?

Time splits the run into six equal parts, dark early and light late. Heading colours each piece of path by its direction in six 60° bands (0° = right, 90° = down the page). Speed colours each piece by its straight length divided by the top speed times the steps it covers, in six equal bands, dark = slow. One colour uses the colour you pick.

Is the run the same every time?

Yes. The start comes from the seed, and every step is worked out the same way, so the same settings give the same trails, bit for bit, in the same browser; our tests check this, and they check the tool against a second stepper of our own written from the rule wording. A flock is very sensitive to tiny differences, so another browser engine can round the last digit of a number differently and, after a few hundred steps, draw a slightly different flock from the same seed.

What does Play do?

It runs the same simulation again and draws the boids moving, a few steps per screen refresh. It pauses when you switch to another tab, carries on when you come back, and stops at the last step. The print always uses the full run.

How big can it go?

Up to 600 boids, 2,000 steps and 250,000 trail points, with boids × boids × steps at most 220 million; every preset draws in under 2 seconds in our tests, and 400 boids for 2,000 steps never gives an invalid number.

Can it print at real size?

Yes, when the drawing fits on one sheet: choose Real size and set the length of one unit (or one cell). Every printed point is within 0.2 mm of its true place in our tests, on US Letter and A4, as long as you print at 100% (Actual size); the check bar in the footer lets you confirm the scale. Bigger drawings print fitted to the page.

Is it free?

Yes. There is no sign-up, no watermark and no limit.

Is anything uploaded?

No. Every step of every boid is worked out by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.