L-System Visualizer

Generate and render Lindenmayer systems (L-Systems) online with turtle graphics. Supports classic presets (Koch Snowflake, Dragon Curve, Barnsley Plant, Sierpinski Arrowhead), custom production rules, iteration caps, and SVG export.

Private • In-browser processing • Zero server uploads

Interactive workspace loading...

How to Use L-System Visualizer

1
Select Preset or Custom
Pick a classic fractal preset or choose Custom Grammar to enter your own rules.
2
Adjust Iterations & Angle
Tune the number of generations (iterations) and turning angle in degrees.
3
View & Export SVG
Inspect the expanded grammar string and copy the generated SVG vector markup.

Key Features

Famous Fractal Presets
Instant one-click rendering of Koch Snowflake, Dragon Curve, Barnsley Fern / Plant, and Sierpinski Arrowhead.
Custom Grammars
Define your own axioms, turn angles, branching symbols (`[` and `]`), and recursive production rules.
Iteration Cap Safety
Protects system memory and browser UI with intelligent string length thresholds.
Clean Vector SVG Export
Exports crisp, infinitely scalable SVG vector drawings suitable for graphic design and laser cutting.

Common Use Cases

  • Modeling plant morphogenesis, tree branching, and organic structures in biological simulations.
  • Generating algorithmic generative art and geometric patterns for graphic design.
  • Computer science education and studying formal grammars, rewriting systems, and recursion.
  • Creating vector paths for pen plotters and CNC laser engravers.

Frequently Asked Questions

An L-System (Lindenmayer system) is a parallel formal grammar introduced in 1968 by biologist Aristid Lindenmayer to model the growth processes of plant development and cell division.

`F` or `G` means move forward and draw a line; `+` turns right by the specified angle; `-` turns left; `[` pushes current position and heading onto a stack; and `]` pops the state back to resume branching.

Because L-System strings grow exponentially with each generation, an uncontrolled recursion can generate billions of characters in seconds. The tool caps iterations to prevent browser crashes.