Generate a Dragon Curve
Draw a Harter-Heighway dragon fractal. Runs entirely in your browser, so your data never leaves your device.
Output
The result appears here as you type.
How to use Generate a Dragon Curve
- 1. Choose the iteration count. Set Iterations to control how many times the curve folds in half. Around 12 iterations produces the familiar dense, jagged dragon silhouette used in most textbook illustrations.
- 2. Size the drawing. Set Width (px) and Height (px) to fit the fold pattern. Higher iteration counts pack in more detail, so a larger canvas keeps individual folds visible instead of blurring together.
- 3. Pick colors and line width. Choose Line color, Background color and Line width to suit your use, whether that is a high-contrast diagram for print or a subtle line for a background texture.
- 4. Review the rendered dragon. The tool draws the Harter-Heighway dragon curve as a single continuous SVG line. Save the file once the fold density and colors look the way you want.
When to use Generate a Dragon Curve
Generate a Dragon Curve draws the Harter-Heighway dragon, produced by repeatedly folding a strip of paper in half and unfolding it at right angles. It is a standard example for teaching recursive construction, self-similarity and the surprising complexity that comes from a single simple folding rule.
- Explaining the paper-folding origin story. The dragon curve comes from literally folding a strip of paper the same direction repeatedly. Showing the rendered curve next to the folding explanation makes the abstract recursion concrete for students.
- Building recursive algorithm teaching material. Computer science courses use the dragon curve to illustrate recursive turtle graphics and L-systems, since the fold rule is one of the simplest ways to generate a genuinely complex shape.
- Decorating generative art or merchandise. The dragon curve's dense, self-similar silhouette works well as a striking pattern for a poster, sticker or phone case background, especially rendered at 10 or more iterations.
- Comparing dragon curve variants. Render the standard dragon curve alongside the twindragon or terdragon to show how folding two or three copies together changes the resulting tiling shape.
Examples
A 12-iteration dragon curve
Output
An SVG drawing of the Harter-Heighway dragon fractal.
About the Generate a Dragon Curve tool
Generate a Dragon Curve does its work locally, right in the browser. Draw a Harter-Heighway dragon fractal. There is no upload step, no queue and no account, and your data never travels over the network.
It belongs to the Math Tools collection on EditSafely, a set of 234 small, focused Math utilities that share the same instant, private workspace.
You can shape the output with 6 settings, including Iterations, Width (px), Height (px) and Line color, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.
Running locally also makes the tool fast and dependable: results appear as you type or drop a file, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.
Frequently asked questions
Does Generate a Dragon Curve cost anything?
Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.
Does the generator send anything to a server?
No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.
How do I get a different result?
Run the generator again. Each run is computed fresh on your device, and any options you change are applied to the next result immediately.
Do I need to sign up or install anything?
Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.
Can I save what the tool produces?
Yes. Use the download or copy controls in the output panel to keep the rendered result once it looks the way you want.