Home▸Geometry▸Sierpinski Carpet — the Menger Sponge's 2D Analogue (2D)

🟪 Sierpinski Carpet — the Menger Sponge's 2D Analogue (2D)

Interactive 2D Canvas Sierpinski carpet: the genuine recursive-subdivision analogue of the 3D Menger sponge. Remove the center square from a 3x3 grid at every level, adjust recursion depth 0-6, animate the recursion, and watch the live fractal dimension log(8)/log(3) converge.

Geometry2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-menger-sponge ↗ Open standalone
⚙ Under the hood

Build the Sierpinski carpet on a Canvas2D grid, the real 2D analogue of the 3D Menger sponge: recursively remove the center square from a 3x3 grid instead of the center and face cubes from a 3x3x3 grid. Adjust recursion depth from 0 to 6, animate the recursion building up level by level, and watch the live remaining-area fraction and fractal dimension log(8)/log(3) converge.

sierpinski carpetfractalrecursionself-similarityfractal dimensioncanvas2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)