L-System Fractal Generator (Koch, Dragon, Plant, Hilbert)
Explore fractals made from simple rewriting rules and download them as SVG.
Use the tool
Why this tool exists
An L-system starts from an axiom and repeatedly replaces each symbol by its rule. The tool expands the string for the chosen number of iterations, then draws it like a turtle: capital letters move forward, + and - turn by the angle, and [ and ] save and restore the position for branches. Presets include the Koch curve, Sierpinski triangle, dragon curve, fractal plant and Hilbert curve; the symbol counts match the known growth formulas (for example 5^n forward moves for the Koch curve).
Strings are limited to two million symbols to keep the page responsive.
No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.
How to use it
- Choose a preset or "custom".
- Set the number of iterations.
- For custom systems enter an axiom, rules like F=F+F-F-F+F and an angle.
- Download the SVG.
Frequently asked questions
What do X and Y do in the presets?
They are control symbols that steer the growth but draw nothing themselves.
Why is it slow at high iterations?
The string grows exponentially; the tool refuses strings over two million symbols.
Can I get the string?
Short results are printed in the output.
Is my data sent anywhere?
No. Everything is processed in your browser, and the page makes no network requests with your input.