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.
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
- Pick a preset, or set the number of boids and the box.
- Set the radius and weight of separation, alignment and cohesion, the top speed and the top steering force.
- Choose the start, the seed and the number of steps, and wait for the preview; press Play to watch it move.
- Choose how to colour the trails and the line width; choose Fitted to one page or Real size and the paper.
- 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
| Preset | Boids | Box | Edges | Weights (sep / ali / coh) | Radii | Steps | Start | Heading match | Groups | Shows | Trail points | Colour by |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Partly aligned: 200 boids, separation 1.5, alignment 1, cohesion 1, 400 steps | 200 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 20 / 30 | 400 | random | 0.793 | 1 | partly aligned | 41,141 | time |
| Partly aligned: 600 boids, 300 steps (the most boids) | 600 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 20 / 30 | 300 | random | 0.561 | 3 | partly aligned | 48,414 | time |
| Aligned flocks: 150 boids all starting to the right | 150 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 20 / 30 | 400 | one heading | 0.993 | 4 | aligned | 30,870 | time |
| Partly aligned: 150 boids starting in the middle | 150 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 20 / 30 | 400 | bunched | 0.568 | 2 | partly aligned | 31,338 | heading |
| Aligned flocks: 250 boids coloured by heading | 250 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 20 / 30 | 400 | random | 0.983 | 2 | aligned | 53,325 | heading |
| Partly aligned: 200 boids in a box with walls | 200 | 300 × 200 | walls | 1.5 / 1 / 1 | 6 / 20 / 30 | 400 | random | 0.877 | 2 | partly aligned | 41,200 | time |
| Unaligned: 200 boids with no alignment (separation and cohesion only) | 200 | 300 × 200 | wrap round | 1.5 / 0 / 1 | 6 / 20 / 30 | 400 | random | 0.127 | 7 | unaligned | 41,181 | time |
| Unaligned: 200 boids with separation only | 200 | 300 × 200 | wrap round | 1.5 / 0 / 0 | 6 / 20 / 30 | 400 | random | 0.062 | 1 | unaligned | 41,176 | time |
| Unaligned: 120 boids with every rule off (straight lines) | 120 | 300 × 200 | wrap round | 0 / 0 / 0 | 6 / 20 / 30 | 300 | random | 0.101 | 1 | unaligned | 18,115 | one colour |
| Partly aligned: 200 boids, cohesion 2, small separation radius | 200 | 300 × 200 | wrap round | 1.5 / 1 / 2 | 4 / 20 / 30 | 400 | random | 0.756 | 3 | partly aligned | 43,443 | heading |
| Aligned flocks: 200 boids, wide view (alignment radius 40) | 200 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 40 / 50 | 400 | random | 0.996 | 1 | aligned | 41,180 | time |
| Aligned flocks: 80 boids, 2,000 steps | 80 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 20 / 30 | 2,000 | random | 0.995 | 1 | aligned | 32,014 | one colour |
| Aligned flocks: 200 boids, gentle turns (max force 0.02), coloured by speed | 200 | 300 × 200 | wrap round | 1.5 / 1 / 1 | 6 / 20 / 30 | 400 | random | 0.950 | 4 | aligned | 43,266 | speed |
| Aligned flocks at real size: 100 boids in 150 × 100 units at 1 mm per unit | 100 | 150 × 100 | wrap round | 1.5 / 1 / 1 | 5 / 15 / 22 | 400 | random | 0.995 | 1 | aligned | 20,561 | time |
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
| Check | Result in our tests |
|---|---|
| One boid, no neighbours | straight line at constant speed 2 for 500 steps |
| Two boids 3 apart, separation only | gap 3, 3.1, 3.3, 3.6, 4, 4.5 … (grows every step) |
| 150 boids all one heading, alignment only | every velocity unchanged after 300 steps |
| Same seed twice | the same trails, bit for bit |
| 400 boids × 2,000 steps | no invalid number; every speed at most the top speed |
| Second stepper of our own | agrees to 1e−6 over 150 steps, wrap round and walls |
What prints
| Download | What is in it |
|---|---|
| The 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 DPI | The same sheet as a picture |
| SVG | The 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 want | Use |
|---|---|
| Paths of a flocking simulation | Boids (this page) |
| Networks grown by trail-following agents | Physarum |
| Cells split by nearest points | Voronoi Generator |
| Random noise textures | Noise Texture Generator |
| Self-similar shapes | Fractal 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.
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.