Maze Generator — A Fresh Maze Every Click
Mazes train planning: looking ahead, backtracking calmly, and holding a route in mind. Because every generated maze is guaranteed solvable (it is carved as one connected path network), students are never defeated by a broken puzzle.
How to Use It
- Pick a difficulty. Easy 8 × 8 suits ages 4–6; Expert 26 × 26 will slow down most adults.
- Generate — every maze is new. Generate again if you want a different one.
- Print for pencil solving in class or at home.
- Stuck (or marking)? Tick "Show solution path" to draw the one correct route in red.
How It Works
The maze is carved with a recursive-backtracker algorithm: starting from the top-left cell, a path is dug through unvisited cells at random until every cell has been reached, which guarantees exactly the maze property teachers want — every cell reachable, no isolated areas, and at least one route from start to finish. The solution is found with breadth-first search, which always returns a shortest path.
Frequently Asked Questions
Is there always a solution?
Yes — by construction. The carving algorithm visits every cell, so a route from the green start to the red finish always exists.
Which difficulty for which age?
Roughly: 8 × 8 for ages 4–6, 12 × 12 for 7–9, 18 × 18 for 10–12, and 26 × 26 for teens and adults — but keen younger children enjoy hard mazes with the solution hidden.
Can I print several different mazes for a class?
Yes — generate, print, generate again. Each class member can even get a different maze at the same difficulty.