Random Fractal Generator

Grow a random fractal from nine constructions -- trees, the Koch snowflake, Sierpinski triangle and carpet, dragon and Levy curves, the Barnsley fern -- seeded, reproducible, and copyable as SVG.

What is a fractal?

A fractal is a shape built from smaller copies of itself, so that zooming in reveals the same structure repeating at every scale -- a property called self-similarity. The term was coined by mathematician Benoit Mandelbrot in 1975, though the family's most famous members, like the Koch snowflake and the Sierpinski triangle, were described decades earlier as mathematical curiosities. Fractals matter beyond their looks because nature builds this way too: coastlines, ferns, river networks, lungs, and lightning all show similar structure across scales. Simple repeated rules generate them, which is why a few lines of code can draw shapes of seemingly endless intricacy.

About this generator

Every press draws a fractal on the site's ink card, from nine constructions: fractal and Pythagoras trees, the Koch snowflake, the Sierpinski triangle, the carpet and Vicsek family, the dragon and Levy C curves, the Barnsley fern, and the H-tree. The seed sets each one's real free parameters rather than just its colour -- the Koch bump angle and base polygon, the dragon's turn angle, the carpet's subdivision rule, the fern's affine coefficients -- so two draws of the same kind are genuinely different figures. Pick a kind and a level of detail, or let each press surprise you.

Every result here is drawn using crypto.getRandomValues() -- the Web Crypto API's cryptographically secure randomness -- instead of Math.random(), so it's genuinely unpredictable, not just statistically random. Learn more.

What people use it for

Generating trees until one looks like your tree is the fractal equivalent of the snowflake page. The famous curves are classroom staples -- generate a few depths of the Koch snowflake and recursion explains itself -- and all of it copies out as crisp SVG for slides, posters, or code-club material.

How it works

Each press draws a 32-bit seed from the site's cryptographically secure randomness and unfolds the drawing deterministically. Trees grow by recursion, each branch spawning two or three smaller ones at seeded angles with per-branch jitter. The Koch rule replaces every edge with four smaller ones at a seeded bump angle, around a base polygon of three to six sides, folded outward or in. The carpet subdivides into three, four, or five parts per side and keeps a seeded pattern of them. The dragon and Levy curves walk their fold sequences at a seeded turn angle. The Detail control sets how deep each construction goes, and is remembered between visits. Same seed, same kind, same detail, same fractal, always.

Common questions

Which fractals can it draw?

Nine: the fractal tree, Koch snowflake, Sierpinski triangle, the carpet and Vicsek family, the dragon curve, the Levy C curve, the Barnsley fern, the Pythagoras tree, and the H-tree. "Surprise me" picks one per press.

Are the famous curves random too?

Yes, in the way they can be. A named curve fixes its rule but not its parameters, so the seed sets the ones the mathematics leaves open -- the angle of the Koch bump, whether it folds outward or in, how many sides the base polygon has, the dragon's turn angle, which cells a carpet keeps. Those change the figure, not just its colour. The tree and the fern are the most freely random of the nine.

Can I get the same fractal back?

Yes -- the drawing is fully determined by the seed stamped on the card, together with the kind and the detail level. Note those three and it can always be redrawn.

Can I use these images?

Freely -- the subtle SVG button in the card's corner copies the artwork as a standalone vector file that scales to any size.

Related Generators

Coat of Arms · Mandala · Maze · Game of Life · Langton's Ant · Walk Art

All Pattern generators

Browse all generators