🧠Cerebite

Maze Generator

Enter at the top-left arrow, exit at the bottom-right. Every maze has exactly one solution — shuffle for a new one, then print.

Tip: print once as a puzzle, then tick “Show solution” and print again for the answer page. “Save as PDF” in the print dialog keeps a file.

Name: ____________Date: ____________
Cerebite · cerebite.com

About this maze generator

Mazes are carved with a depth-first “recursive backtracker” algorithm, which guarantees a perfect maze: every cell is reachable and there is exactly one path between any two points — so the puzzle always has one unique solution. Each click of “New maze” produces a different layout, letting you print as many unique activity sheets as you need. Solving mazes exercises planning and spatial reasoning; pencil tip: work backwards from the exit when you get stuck.

How a maze with one solution is carved

The generator starts with a solid grid of walls and digs a path through it using a depth-first search with backtracking. It walks to a random neighbouring cell, knocks down the wall between them, and keeps going until it reaches a dead end; then it retreats along its own route until it finds a cell with an unvisited neighbour and sets off again. When every cell has been visited, the maze is done.

The result is what mathematicians call a perfect maze: every cell is reachable, there are no loops, and there is exactly one path between any two points. That guarantee is why the puzzle always has a single solution and why it can never be impossible — properties that hand-drawn mazes rarely have.

Each press of the new-maze button reruns the whole process with different random choices, so you can print as many distinct sheets as you need without any of them repeating.

Solving strategies worth teaching

What mazes are good for

Solving a maze exercises planning and spatial reasoning in a way that is unusually visible: you can watch someone shift from trying every turn at random to looking ahead before committing, and that shift is the whole skill. It also builds tolerance for backtracking, which is a genuinely useful habit and one that puzzles teach better than instruction does.

For printing, larger grids suit older solvers and quiet activities, while smaller ones finish quickly enough to keep a beginner engaged. Everything is generated in your browser, so there is no watermark, no limit and nothing to sign up for.

Frequently asked questions

Does every maze really have only one solution?
Yes. The generator carves a “perfect maze”: a spanning tree of the grid, so there are no loops and exactly one path connects any two cells — including the entrance and exit. The solution page draws that unique path.
How do I print a clean puzzle plus a separate answer page?
Print once with “Show solution” unticked (the puzzle), then tick it and print again (the answer). Only the maze sheet is printed — the page header, form and ads are hidden automatically.
Which size should I pick?
10×10 suits young beginners and takes a couple of minutes; 15×15 is a comfortable everyday puzzle; 20×20 can take a good while even for adults. Since every click makes a new maze, print a batch at mixed sizes for varied difficulty.
What's the difference between a maze and a labyrinth?
Strictly speaking, a labyrinth has a single winding path with no choices — you just follow it to the center — while a maze branches and demands decisions, with dead ends to punish wrong ones. The puzzles generated here are true mazes.
What's the best strategy for solving a maze?
The wall follower: keep one hand on the same wall (always left or always right) and you're guaranteed to reach the exit of a perfect maze like these. On paper, dead-end filling is faster — shade in every dead end until only the solution path remains.
Are printed mazes good practice for young learners?
Yes — tracing a path trains planning ahead, spatial reasoning and pencil control, which is why mazes are a staple of early-learning workbooks. Start young learners on 10×10, and let them draw the route with a finger first before committing with a pencil.