Spirograph Generator screenshot

Spirograph Generator

Draw a hypotrochoid spirograph as SVG from a fixed radius, a moving radius, a pen offset and turns.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
States its rule
Nothing uploaded

What this Spirograph Generator does

Draw a hypotrochoid spirograph as SVG from a fixed radius, a moving radius, a pen offset and turns.

A pen at distance d from the centre of a circle of radius r rolls inside a fixed circle of radius R, tracing x = (R−r)cos t + d cos(((R−r)/r)t) and y = (R−r)sin t − d sin(((R−r)/r)t). The page samples 2400 points over the turns you ask for and joins them into one path. No randomness is used, so the same four values draw the same curve. The radii, turns and point count are carried as data attributes on the root element, so the drawing stays the whole output.

How to use it

Enter Fixed radius (R), Moving radius (r), Pen offset (d), Turns, then press Run. The page recalculates from the values on screen and prints the rule it applied.

Worked example

Input:

Fixed radius (R) = 100
Moving radius (r) = 40
Pen offset (d) = 30
Turns = 12

Output:

SVG drawing = an SVG drawing (rendered in the output pane)

Why it runs in your browser

This page runs entirely in this tab: no value is posted to a server, no cookie or storage entry is written, and reloading the page discards everything. Static HTML and JavaScript only — the same source served to every visitor, with no network call and no server-side executor.

Spirograph Generator: Draw a hypotrochoid spirograph as SVG from a fixed radius, a moving radius, a pen offset and turns.

A pen at distance d from the centre of a circle of radius r rolls inside a fixed circle of radius R, tracing x = (R−r)cos t + d cos(((R−r)/r)t) and y = (R−r)sin t − d sin(((R−r)/r)t). The page samples 2400 points over the turns you ask for and joins them into one path. No randomness is used, so the same four values draw the same curve. The radii, turns and point count are carried as data attributes on the root element, so the drawing stays the whole output.

Worked example: Fixed radius (R) = 100, Moving radius (r) = 40, Pen offset (d) = 30, Turns = 12 gives SVG drawing = an SVG drawing (rendered in the output pane).

How to use the Spirograph Generator calculator

Enter Fixed radius (R), Moving radius (r), Pen offset (d), Turns, then press Run. The page recalculates from the values on screen and prints the rule it applied.

This page runs entirely in this tab: no value is posted to a server, no cookie or storage entry is written, and reloading the page discards everything.

  • Fixed radius (R) — a number
  • Moving radius (r) — a number
  • Pen offset (d) — a number
  • Turns — a number

The rule this page applies

A pen at distance d from the centre of a circle of radius r rolls inside a fixed circle of radius R, tracing x = (R−r)cos t + d cos(((R−r)/r)t) and y = (R−r)sin t − d sin(((R−r)/r)t). The page samples 2400 points over the turns you ask for and joins them into one path. No randomness is used, so the same four values draw the same curve. The radii, turns and point count are carried as data attributes on the root element, so the drawing stays the whole output.

Static HTML and JavaScript only — the same source served to every visitor, with no network call and no server-side executor.

  • SVG drawing = an SVG drawing (rendered in the output pane)

What to Expect

Best for

  • Getting the svg drawing quickly
  • Checked arithmetic, printed with its rule
  • Comparing two sets of inputs

Not ideal for

  • Data this page does not carry
  • A guarantee about the physical world
  • Locales other than English

What this tool keeps

  • Your inputs in this tab
  • The rule, printed in full
  • The same answer on every run

What may need cleanup

  • A value the page refuses, which names the field instead of guessing
  • A number outside the stated range, which is refused by name

Common errors

  • A blank field is refused rather than read as zero
  • A zero denominator is refused rather than printed as infinity
  • A value outside the formula’s range is refused with the range named

Example use cases

  • Checking a figure before you rely on it
  • Homework and exam checking
  • Comparing two options side by side

Sample input

Fixed radius (R) = 100, Moving radius (r) = 40, Pen offset (d) = 30, Turns = 12

Sample output

SVG drawing = an SVG drawing (rendered in the output pane)

Who this is for

  • Anyone checking this figure by hand
  • Students and teachers

Frequently asked questions

What does the Spirograph Generator calculator do?

Draw a hypotrochoid spirograph as SVG from a fixed radius, a moving radius, a pen offset and turns. It prints svg drawing.

How does this page work out the answer?

A pen at distance d from the centre of a circle of radius r rolls inside a fixed circle of radius R, tracing x = (R−r)cos t + d cos(((R−r)/r)t) and y = (R−r)sin t − d sin(((R−r)/r)t). The page samples 2400 points over the turns you ask for and joins them into one path. No randomness is used, so the same four values draw the same curve. The radii, turns and point count are carried as data attributes on the root element, so the drawing stays the whole output.

Is anything uploaded or stored?

This page runs entirely in this tab: no value is posted to a server, no cookie or storage entry is written, and reloading the page discards everything.

Which inputs does the page read?

It reads Fixed radius (R), Moving radius (r), Pen offset (d), Turns. Every other value is derived from those.

What makes the pattern close?

When the ratio of the two radii is rational, the curve closes after a whole number of turns. Try R:r of 5:2 or 3:1 and compare with an irrational-looking pair.

Why must the pen offset stay under the moving radius?

Because the pen sits inside the rolling circle. A larger offset is a different curve (an epitrochoid-style excursion) that this page does not draw.

Can I save the drawing?

Copy the SVG from the output box. Nothing is uploaded or stored, so the text is the artifact.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.