A virtual spirograph: pick a fixed ring, a rolling gear and a pen hole, then watch the gear roll and trace the pattern. Stack layers in different colors and download your design as a PNG image or a scalable SVG.
Last updated:
Layers
Advertisement
Advertisement
How to use the Spirograph Generator
Choose Inside ring or Outside ring to roll the gear inside or around the fixed ring.
Set the teeth of the fixed ring and the rolling gear, and the pen offset (how far the pen hole is from the gear's center). The preview updates instantly.
Press Draw pattern to watch the gear trace the curve. Change the drawing speed or switch off the gears if you like.
Press Add layer to keep the current pattern and start a new one on top in another color. Try Random pattern or a preset for ideas.
Download PNG or SVG when you're happy. Pick a transparent background to use the design on top of other artwork.
The math behind the spirograph
The curves drawn here are roulettes: the path of a point attached to a circle that rolls along another circle. With a fixed ring of radius R, a rolling gear of radius r and the pen at distance d from the gear's center, the angle t of the gear around the ring gives:
Curve
Gear position
Equations
Hypotrochoid
Inside the ring
x = (R − r)cos t + d·cos(((R − r)/r)·t) y = (R − r)sin t − d·sin(((R − r)/r)·t)
Epitrochoid
Outside the ring
x = (R + r)cos t − d·cos(((R + r)/r)·t) y = (R + r)sin t − d·sin(((R + r)/r)·t)
Because gear teeth have the same size on both parts, the number of teeth is proportional to the radius, so the tooth counts can be used directly as R and r. The curve closes after t = 2π · r / gcd(R, r).
Lobes and turns for common gear pairs
Ring teeth (R)
Gear teeth (r)
GCD
Lobes (R ÷ GCD)
Trips around the ring (r ÷ GCD)
96
36
12
8
3
105
63
21
5
3
90
30
30
3
1
150
57
3
50
19
144
89
1
144
89
Tips for striking designs
Layer the same gears with different pen offsets for a nested, flower-like look. Add layer does this automatically, then adjust from there.
Use thin lines for dense patterns. Pairs with a GCD of 1 to 3 draw hundreds of loops; a 0.5–1 px line keeps them crisp.
Try a dark background with bright colors or the rainbow pen for a neon effect.
Pen offset 100% gives sharp cusps: an inside gear then draws a star-shaped hypocycloid, and an outside gear a flower-like epicycloid.
Export SVG for print or plotting. Vector paths stay sharp at any size and can be recolored in any vector editor.
Frequently asked questions
How does a spirograph work?
A toothed gear rolls without slipping around the inside or outside of a fixed toothed ring. A pen placed in a hole of the gear traces a looping curve. Rolling inside gives a hypotrochoid; rolling outside gives an epitrochoid. This generator uses the exact equations of those curves.
What are the spirograph equations?
For a gear of radius r rolling inside a ring of radius R with the pen at distance d from the gear's center: x = (R − r)·cos t + d·cos((R − r)t / r) and y = (R − r)·sin t − d·sin((R − r)t / r). Rolling outside: x = (R + r)·cos t − d·cos((R + r)t / r) and y = (R + r)·sin t − d·sin((R + r)t / r).
How many points or loops will my pattern have?
Divide both tooth counts by their greatest common divisor (GCD). The ring's result is the number of lobes, and the gear's result is how many times the gear travels around the ring before the curve closes. For 96 and 36 the GCD is 12, so you get 8 lobes after 3 trips around the ring.
Why do some settings make simple shapes and others very dense ones?
If the tooth counts share a large common divisor the curve closes quickly and looks simple. If they share few factors (for example 89 and 144) the gear must go around many times before the curve repeats, which creates a fine, lace-like pattern.
Can I use the designs commercially?
Yes. The patterns are generated from mathematical curves in your browser and the files you download are yours to use. The SVG is a vector file, so it can be scaled for printing, laser cutting or plotting without losing quality.
What does pen offset over 100% mean?
A pen offset of 100% puts the pen exactly on the gear's edge, which draws sharp points (a hypocycloid or epicycloid). Below 100% the pen sits inside the gear like a real spirograph hole, giving rounded loops; above 100% it's outside the gear, which adds extra loops.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.