L-System Generator
Define custom L-system rules and visualize the resulting fractal. Choose from presets or create your own.
What Is an L-System?
Pick a preset like Dragon Curve or Koch Snowflake, or write your own axiom and rules, then watch the fractal draw itself on the canvas. Tweak the angle, iteration count, stroke color, and line width until the shape looks right, then save it as a PNG. And everything runs in your browser. Nothing gets uploaded.
FAQ
What do the symbols mean?
F and G draw a line forward. + turns left by the specified angle. - turns right. [ saves the current position and angle (push). ] restores the last saved position and angle (pop). Any other uppercase letters move forward drawing; lowercase letters move forward without drawing.
Why is there a max iteration limit?
L-systems grow exponentially. At high iterations the string can contain millions of characters and the resulting curve can have millions of segments, which would crash the browser. The limit of 14 iterations keeps rendering fast.
Can I create my own rules?
Yes! Enter any axiom and rules. Each rule should be on its own line in the format X=replacement, where X is a single character and replacement is the string it expands to.
What is the angle for?
The angle determines how many degrees the turtle turns when it encounters a + or - symbol. 90° produces square-like patterns, 60° produces hexagonal patterns, and 25° produces realistic plant-like forms.
Can I download the result?
Yes, click "Download PNG" to save the rendered fractal as a high-quality PNG image.