Generate printable mazes for classrooms, puzzle books, kids’ activities or your own fun. Every maze is a perfect maze — there is exactly one path between any two points — so there is always a single clean route from the green start in the top-left to the red finish in the bottom-right, with no looping shortcuts.
How it works
The grid starts as a solid block of cells, each with four walls. The generator then runs the recursive backtracker (a randomised depth-first search): from the top-left cell it repeatedly knocks down the wall to a random unvisited neighbour, moves there, and when a cell has no unvisited neighbours it backtracks up the path it came from. Because every cell is visited exactly once and joined by a single removed wall, the result is mathematically guaranteed to be a perfect maze. The finished grid is drawn as crisp SVG vector lines.
What makes this a “perfect” maze?
Not all mazes are created equal. A perfect maze has two defining properties: every pair of cells is connected by exactly one path, and there are no loops or isolated regions. This means:
- The solution path is always unique — no ambiguity
- Every dead end is genuinely a dead end, not a shortcut
- The maze fills the entire grid with no wasted, unreachable areas
Other algorithms (like Prim’s or Kruskal’s) also produce perfect mazes but with different “personalities” — Prim’s creates more branchy, twisty passages; the recursive backtracker tends to carve longer, more winding corridors with fewer short dead ends. You can notice this difference as the solver works through the maze.
Size guide
| Size | Grid | Typical solve time | Best for |
|---|---|---|---|
| Small | 10×10 | Under 1 minute | Young children, quick puzzles |
| Medium | 16×16 | 2–5 minutes | Classrooms, activity sheets |
| Large | 24×24 | 5–15 minutes | Older kids, puzzle books |
Printing tips
Because the maze is drawn as SVG vector graphics, it scales to any paper size without losing sharpness. For the best print result:
- Use your browser’s File → Print dialog and choose “Fit to page” to fill the paper
- Choose “Save as PDF” instead of printing to keep a digital copy you can share
- A4/Letter paper works well for all three sizes; larger paper makes the 24×24 maze easier to solve
Each time you click Generate you get a completely different maze — so you can produce a fresh worksheet for every class or puzzle session.