Home▸Algorithms & AI▸Maze Generator — Recursive Backtracker & Prim's Algorithm (2D)

🌀 Maze Generator — Recursive Backtracker & Prim's Algorithm (2D)

Watch a perfect maze grow cell by cell with a top-down 2D Canvas maze generator. Choose Recursive Backtracker (DFS) or Randomized Prim's algorithm, then solve the maze with BFS pathfinding.

Algorithms & AI2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-maze-generator ↗ Open standalone
⚙ Under the hood

Watch a perfect maze grow cell by cell in this top-down 2D maze generator. Choose the Recursive Backtracker (DFS) or Randomized Prim's algorithm, animate the build step by step, then solve the finished maze with breadth-first search to find the shortest path from entrance to exit.

mazealgorithmsrecursive backtrackingPrim's algorithmpathfinding2D

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

What did you find?

Add reproduction steps (optional)