Dragon Curve Generator

Build the Heighway dragon from repeated paper folds or L-system rules. Change depth and colors, watch it grow, or export your curve as an image.

12
3
Iteration12Segments0L-system length0Curve length0

From paper to L-system

Fold a strip in half repeatedly, then unfold with every crease at 90°. The shape you get is the Dragon Curve. The same sequence appears in the L-system below.

Rules used here

Axiom F. Rules: F → F+G, G → F−G. + and are right and left 90° turns. Each step doubles the length of the path plus one.

Why it never crosses

The curve is self-avoiding. It winds through the plane and in the limit fills it. Fractal dimension is 2. The turn sequence is palindromic around the center: R (sequence) R (reverse with R↔L).

Binary shortcut

For position k: write k in binary, drop trailing zeros. If the last bit is 1, turn right; if 0, turn left. That gives the same sequence as paper folding.