SimulatorEducationDeveloperEntertainment

L-system Generator

Build Lindenmayer systems in the browser. Edit axiom and rewrite rules, sweep the iteration count, and watch trees, snowflakes, dragon curves and space-filling fractals emerge from a few characters.

Presets

Iterations5

Turtle commands: F forward (draws), + turn left, − turn right, [ ] push / pop position.

Angle25°
Line thickness1.2px

Palette

6,263 symbols · 1,488 segments

What is an L-system?

An L-system (Lindenmayer system) is a tiny language for growing strings by rewriting them in parallel. Botanist Aristid Lindenmayer invented it in 1968 to model how algae, ferns, and trees develop cell by cell — and it turns out the same machinery draws snowflakes, dragon curves, and entire family trees of fractal art.

You give it three things: an axiom (the starting string), a set of rewrite rules (each symbol becomes a longer string), and a number of iterations. The system applies every rule to every character simultaneously, over and over.

axiom: F

rule: F → F+F−F−F+F

iter 0: F

iter 1: F+F−F−F+F

iter 2: F+F−F−F+F + F+F−F−F+F − F+F−F−F+F − F+F−F−F+F + F+F−F−F+F

The final string is then read by a turtle that walks the plane.

Turtle commands

SymbolAction
F (and G)Step forward and draw a line
fStep forward without drawing
+Turn left by the angle
−Turn right by the angle
[Push current position and direction (start a branch)
]Pop position and direction (return from branch)
X, Y, A, B…Don't draw — used only as rewrite hooks

The [ ] bracket pair is what makes trees possible: branches start by pushing the turtle's state, grow, then pop back to keep growing the trunk.

Classic systems shipped as presets

Fractal Plant

Lindenmayer's iconic fern from his 1968 paper. Branching via [ ].

Bush

Self-similar shrub — 3 branches per F, very dense at iter 4.

Koch Curve

1904 fractal — infinite length, zero area.

Koch Snowflake

Three Koch curves joined; outline of a finite triangle becomes infinite.

Dragon Curve

Born from paper folding — fills a region with no self-crossings.

Sierpinski

Classic triangle, here drawn via two-letter rewriting.

Hilbert

Space-filling curve that visits every cell of a 2D grid.

Lévy C

Self-similar curve named for Paul Lévy — pure recursion.

Tips for inventing your own

  • String grows fast. Each iteration multiplies length by the longest rule body. Start at iter 3–4 before going higher.
  • Wrap branches in [ ]. Plants and trees need it; pure curves like Koch don't.
  • Use non-drawing letters (X, Y). They let you control the structure without making lines; F is the "ink".
  • Tune angle alongside rules. The same string at 90° vs 60° vs 22.5° is a totally different creature.
  • Aim small, sweep big. Tiny rule edits often flip the shape entirely — that's the joy of L-systems.