Sierpinski Triangle Generator

Build the classic Sierpinski fractal by recursion, chaos game, or triangle removal. Change depth and style, watch it grow step by step, or export your pattern as an image.

6
320
1
Iteration6Triangles0MethodRecursiveArea0%

Three ways to get the same fractal

Recursion: split each triangle into three by joining midpoints and skip the center. Chaos game: pick a random vertex, jump halfway toward it, repeat. Triangle removal: start filled, then repeatedly remove the central quarter. All three produce the same limit shape.

Why the area shrinks

Each step keeps three of four smaller triangles. Remaining area is (3/4)n after n steps, so it tends to zero while the perimeter grows. The fractal dimension is log 3 / log 2.

Pascal and cellular automata

Color odd entries in Pascal's triangle black and even white: the Sierpinski pattern appears. The same pattern shows up in Rule 90 one-dimensional cellular automata.