Maze Generator

Create printable mazes with one solution path — small to large.

Free maze generator. Build printable square mazes in small, medium, or large sizes, each a perfect maze with exactly one solution path from start to finish. Drawn as crisp SVG in your browser — nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Does the maze always have a solution?

Yes. The generator builds a perfect maze, meaning there is exactly one path between any two cells, so there is always a single route from the green start to the red finish.

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

SizeGridTypical solve timeBest for
Small10×10Under 1 minuteYoung children, quick puzzles
Medium16×162–5 minutesClassrooms, activity sheets
Large24×245–15 minutesOlder 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.