GenerateRandomSearch

Spirograph Generator

A spirograph curve is a hypotrochoid: the path of a point on a wheel rolling inside a ring. How long it takes to close is not a matter of taste — it is the wheel's tooth count divided by the greatest common divisor of the two, and the number of points around the outside is the ring's count divided by the same. This draws the curve and confirms it returns exactly to where it started.

What this generator does

Traces the path of a point on a wheel rolling inside a ring, sampling the curve over exactly the number of revolutions needed to close it. That count comes from the greatest common divisor of the two tooth counts, and the curve is checked to return to its start.

How to use this tool

  1. Set the ring and wheel tooth counts.
  2. Set how far the pen sits from the wheel's centre.
  3. Read how many revolutions it takes to close.
  4. Try coprime numbers for the densest curves.

Understanding the controls

Ring teeth
The fixed outer ring. Only the ratio to the wheel matters for the shape.
Wheel teeth
The rolling inner wheel. Sharing a large factor with the ring closes the curve quickly; coprime counts take the longest and give the densest results.
Pen offset
How far the pen sits from the wheel's centre. At the rim you get sharp cusps; near the centre the curve becomes almost circular.

Common use cases

  • Drawing spirograph curves without the physical toy
  • Seeing why some gear pairs close immediately and others take dozens of turns
  • Generating decorative curves for a print or a laser cutter
  • Teaching the greatest common divisor with a visible consequence
  • Exploring how the pen offset changes the shape

How this generator works

The wheel rolls inside the ring, so the pen traces a hypotrochoid — a combination of two circular motions whose ratio is set by the tooth counts. The curve closes when the wheel returns to its starting orientation at its starting position, which happens after the wheel count divided by the greatest common divisor of the two. Before display that count is re-derived, the curve is confirmed to return to its exact starting point, and every sampled point is checked to lie inside the ring.

Randomness and fairness

Nothing here is random. Two tooth counts and an offset give exactly one curve.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Only hypotrochoids — a wheel inside a ring. Epitrochoids, where the wheel rolls outside, make a different family of curves.
  • The curve is sampled at two thousand points, so a very dense curve is drawn slightly approximately.
  • Tooth counts are the radii here rather than physical gear teeth, which behave the same way but count differently on a real toy.
  • Line thickness and colour are fixed; this produces the geometry rather than a finished piece.

Privacy and your data

The curve is computed in your browser and the numbers you enter are never transmitted, stored or included in analytics.