Spirograph Generator

Make spirograph patterns online. Adjust frequency ratio, radii, arms, trail length and harmonograph damping, watch it draw live, and export a PNG or video. Free, no signup, runs in your browser.

Pick an animation

All 28 animations →

Canvas 2D
three.js
WebGL
CSS / DOM
Spirograph Trails

Live controls

-3
0.012
4
0.54
0.32
0
220
0.16
300
1

Knobs patch the running animation live. A few (marked in the code as baked-in values like particle counts) restart the preview.

Two stacked radii per arm, plus a fading trail. Change ratio.

Your code runs in a sandboxed frame with no access to this page, and it is never sent to a server. three.js demos load the library from jsDelivr; the rest need nothing but the browser.

Advertisement

Draw spirograph patterns online

A spirograph traces the path of a point on one rotating circle as it rolls around another. Written directly, that is two rotations added together:

x = R₁·cos(t) + R₂·cos(ratio·t)
y = R₁·sin(t) + R₂·sin(ratio·t)

Everything about the figure comes from those four numbers. This generator draws them live so you can see each one take effect.

Controls

  • Frequency ratio — the single most important value. Whole numbers close the curve into a clean rosette; a ratio of −3 gives a three-lobed figure, −5 gives five. Negative values wind the inner circle the other way, which produces the classic toy-spirograph look. Fractional values (try 2.5 or 3.25) take much longer to close and produce dense woven patterns.
  • Outer / inner radius — the size of the two rotations. Making them equal produces a cardioid; making the inner one small keeps the figure near a plain circle.
  • Arms — how many pens draw at once, evenly spaced in phase. More arms give a symmetric, layered figure.
  • Harmonograph damping — a real harmonograph is a pendulum, and pendulums lose energy. Turn this up and the radii shrink as the drawing proceeds, so the closed figure spirals inward. Zero gives you a pure spirograph; anything above zero gives you a harmonograph.
  • Trail points and canvas fade — how much of the path stays visible. Set fade to zero and the drawing accumulates permanently, which is what you want before exporting a still.

Spirograph vs harmonograph

They are often confused. A spirograph is geometric: circles rolling on circles, and the figure repeats forever without changing. A harmonograph is physical: pendulums swinging at different frequencies, drawing until friction stops them. The damping control here is exactly that friction, which is why turning it up converts one into the other.

Making a clean print

Set canvas fade to 0 so nothing decays, raise trail points to its maximum, and let it draw until the figure closes. Then Save PNG. For an animated version, use Record instead — a slow speed with a fractional ratio makes a good loop.

Everything runs in your browser and nothing is uploaded.

The maths behind the curve

A spirograph figure is the sum of two rotations, one attached to the tip of the other:

x = R1 cos(t) + R2 cos(k t)
y = R1 sin(t) + R2 sin(k t)

where k is the frequency ratio. This family of curves has proper names: when the small circle rolls around the outside of the fixed one the result is an epitrochoid, and when it rolls around the inside it is a hypotrochoid. The plastic toy produces hypotrochoids, which is why negative ratios here look most like the toy.

When does the curve close?

This is the question the ratio really answers. Write k as a fraction in lowest terms, p/q. The curve closes after exactly q full turns of the outer arm. Some consequences:

  • k = -3 is -3/1, so it closes after one turn. Instantly symmetric.
  • k = 2.5 is 5/2, so it needs two turns to close.
  • k = 3.25 is 13/4: four turns, and a much denser figure.
  • An irrational ratio never closes. It fills an annulus densely, forever, never exactly repeating.

Denominators are why small slider changes produce wildly different figures: 2.50 and 2.51 are 5/2 and 251/100, and one closes in two turns while the other takes a hundred.

Relationship to Fourier series

Adding rotating arms of different frequencies is precisely what a Fourier series does. Two arms give these curves; add more, with the right radii and frequencies, and you can trace any closed curve — which is the basis of the "drawing with epicycles" animations. This tool is a two-term Fourier series that you can steer by hand.

Harmonographs, damping, and printing

The physical machine

A harmonograph is a Victorian drawing machine: two or three pendulums swinging at slightly different frequencies, connected to a pen and a moving table. It was used to visualise musical intervals — pendulums tuned to a 3:2 frequency ratio (a perfect fifth) trace a stable, simple figure, while dissonant ratios produce tangled ones.

The crucial physical difference from a geometric spirograph is that pendulums lose energy. Amplitude decays exponentially:

decay = exp(-t * damping)

so the radii shrink as the drawing proceeds and the closed figure spirals inward, never retracing itself exactly. That is the damping control here. At zero you have pure geometry; above zero you have physics.

Getting a clean export

The trail controls decide whether you are producing an animation or a print:

  1. Set Canvas fade to 0 so nothing decays off the canvas.
  2. Raise Trail points to maximum so the whole path is retained.
  3. Let it run until the figure closes on itself — a p/q ratio needs q turns.
  4. Save PNG.

For a looping animation instead, keep a small fade, choose a fractional ratio so the pattern keeps evolving, and use Record to capture WebM.

Colour

Each arm is drawn on its own hue, spaced across the range set by the hue spread control, and each trail ramps in width and brightness from tail to head. That head-to-tail gradient is what makes the line read as motion rather than as a static wireframe.

Frequently Asked Questions

What does the frequency ratio actually control?+

It is the speed of the second rotating arm relative to the first, and it decides the identity of the figure. Whole numbers close the curve into a clean rosette - a ratio of -3 gives three lobes, -5 gives five. Negative values counter-rotate the inner arm, which produces the classic toy-spirograph look. Fractional values like 2.5 take far longer to close and weave much denser patterns. Every other control changes proportions; this one changes the shape.

What is the difference between a spirograph and a harmonograph?+

A spirograph is geometric: circles rolling on circles, tracing a figure that repeats forever unchanged. A harmonograph is a physical machine - pendulums swinging at different frequencies with a pen attached - and pendulums lose energy to friction, so the figure spirals inward as it draws. The damping control here is exactly that friction. At zero you have a spirograph; above zero you have a harmonograph.

How do I export a clean image?+

Set Canvas fade to 0 so nothing decays, raise Trail points to maximum, and let the figure draw until it closes on itself. Then use Save PNG. For an animated version use Record instead, which produces a WebM video - a slow speed with a fractional ratio makes a good loop.

Can I use the patterns commercially?+

Yes. The output is a mathematical curve, not a copyrighted asset, and the source code shown in the editor is free to reuse. Nothing you make here is uploaded or stored.

Related tools

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.