SimulatorEntertainmentEducationUtility

Maze Generator

Generate random mazes online. Choose grid size, algorithm (recursive backtracker or Prim's), wall thickness, reveal the solution path, and download a printable PNG.

24×24 · backtracker · seed 20240518

24 × 24
2 px

Perfect mazes

Every maze produced here is a perfect maze: there is exactly one path between any two cells, no loops and no isolated areas. In graph terms the maze is a spanning tree of the grid — which is why the solution path (top-left to bottom-right) is always unique.

Generation is fully seeded: the same seed, size and algorithm always reproduce the identical maze, so you can share or reprint a specific puzzle.

Algorithms

Recursive backtracker

A depth-first carve that drills long, winding corridors before backtracking. Produces mazes with few junctions and long passages — feels twisty and hard.

Randomised Prim's

Grows the maze outward from a random frontier of walls. Yields many short branches and a more uniform, bushy texture — easier to scan visually.

Solving & printing tips

  • Solution path: toggling it runs a breadth-first search, which always returns the shortest (and, for a perfect maze, only) route from the top-left entrance to the bottom-right exit.
  • For printing: use a larger grid (30–50), wall thickness 2–3, solution off. Download the PNG and drop it into any document at full width.
  • For kids: small grids (8–15) with thicker walls are easier and clearer.

Uses

Printable puzzle sheets and classroom worksheets, game level layouts, pathfinding and algorithm demos, escape-room props, and generative art. Because output is deterministic per seed, mazes double as reproducible test fixtures for maze-solving code.