Random Spirograph Generator

Draw a real roulette curve -- one circle rolling inside or outside another -- from a random seed. Every figure closes exactly, and copies out as SVG.

What is a spirograph curve?

A spirograph draws a roulette: the path traced by a point fixed to one circle as that circle rolls around another. Rolling inside gives a hypotrochoid, outside gives an epitrochoid, and three numbers decide everything -- the fixed circle's radius R, the rolling circle's radius r, and how far the pen sits from the rolling circle's centre. The pattern closes and repeats after r divided by the greatest common divisor of R and r turns, which is exactly why the toy's gears have prime-ish tooth counts: coprime gears give the many-lobed figures, and gears that share a factor give simple ones.

About this generator

Every press draws a genuine roulette curve -- not a decorative approximation. A seed sets the two radii, the pen offset, whether the small circle rolls inside or outside, and how many overlapping passes are drawn, then the figure is scaled to fill the card. The radii are whole numbers, so each curve closes exactly on itself the way the physical toy does, and the seed and parameters printed under the drawing rebuild it exactly.

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

It's a good screen to think in front of, and the SVG copies out cleanly for laser cutting, embroidery patterns, tattoo references, or print. It's also the fastest way to see what the gear ratios in the original toy were doing: draw a dozen and the relationship between the numbers and the number of lobes becomes obvious.

How it works

Each press draws a 32-bit seed from the site's cryptographically secure randomness. The seed picks R, r, and the pen distance d, then the curve is sampled at up to several thousand points along its full period -- enough that the tightest loops stay smooth -- and drawn as a single closed path per layer. With animations on, the whole figure turns slowly; the parameters printed under it will reproduce it exactly.

Common questions

What do R, r and d mean?

R is the fixed outer circle, r the rolling circle, and d how far the pen sits from that rolling circle's centre. On the physical toy, R and r are the two gears' tooth counts and d is which hole you put the pen in.

Why do some figures have many more lobes than others?

The lobe count is R divided by the greatest common divisor of R and r. When the two share no factors you get the maximum number of lobes; when they share a large one, the curve closes quickly and looks simple.

Can I save one?

Use the SVG button in the corner of the card to copy the figure as a vector, which scales to any size without going soft. The seed under the drawing brings the same curve back later.

Related Generators

Coat of Arms · Mandala · Maze · Game of Life · Langton's Ant · Fractal

All Pattern generators

Browse all generators