Maze Generator

Make a printable maze in seconds.

Pick the size and difficulty, add a name and date line, print it in black and white, and keep the answer key for marking.

Last updatedHow we build & check our tools
Results will appear here once you enter your values.

How a maze generator actually builds a maze

Start with a grid of squares and put a wall between every pair of neighbours. A maze generator then knocks walls down, one at a time, following a rule that never connects two squares that are already reachable from each other. When it runs out of moves, every square can be reached and there is exactly one route between any two of them. Puzzle makers call that a perfect maze, and it is what makes an answer key possible: there is one correct path, not several.

The rule you use for knocking down walls decides what the finished maze feels like. This tool offers three, and the difficulty setting is really a choice between them.

  • Randomised Prim (Easier): grows outward from a single square, always knocking down a random wall on the current edge of the finished region. It branches constantly, so it ends up with more dead ends than either other method, and almost all of them are short. On a 20x20 grid it averages about 126 dead ends and a correct path of roughly 42 squares, barely longer than the 39-square minimum.
  • Randomised Kruskal (Medium): shuffles every wall in the grid and removes it whenever it separates two regions that are not yet joined. Because the maze grows everywhere at once rather than from one point, the texture is the most even of the three. On the same grid it averages about 118 dead ends and a 58-square path.
  • Recursive backtracking (Harder): walks forward as far as it can, only backing up when every neighbouring square has already been visited. This is depth-first search, and it produces long snaking corridors instead of a bush. Only about 42 dead ends on a 20x20 grid, but the correct path averages 168 squares, so those few dead ends are long ones.

All three finish with the same guarantee. Nobody gets a maze with no way out.

What makes one maze harder than another

Size is the obvious lever, and it is the weakest one. Doubling the grid roughly doubles the time a child spends on the page, but it does not make the puzzle cleverer. Three other things matter more.

  • How long a wrong turn costs you. In a maze full of short dead ends, a mistake is obvious in three or four squares. In a maze built from long corridors, the same mistake can lead you twenty squares away before it closes. That is the single biggest difference between the Easier and Harder settings here.
  • How many choices you face. Junctions are decision points. A bushy maze has more of them but punishes each wrong choice lightly. A corridor-heavy maze has fewer decisions that each carry more weight, which is why it feels tense rather than fiddly.
  • How far the true path wanders. The solution counter under the maze shows how many squares the correct route passes through. When that number is close to the width plus the height, the answer is nearly a straight run. When it is three or four times that, the path doubles back on itself and the maze feels genuinely twisty.

The dead-end count under each maze is a quick read on the first two. A 15x15 grid on the Easier setting typically shows far more dead ends than the same grid on Harder, even though both have the same number of squares. If you want a harder puzzle without a bigger sheet of paper, change the difficulty rather than the size.

One more honest note: children usually solve mazes backwards. Working from the exit is easier because dead ends thin out as you approach the start. If a class finds a maze too easy, that is often why, and the Harder setting is the fix.

Printing mazes without wasting ink or paper

A maze is one of the cheapest things you can print, provided the page is built for it. This one is drawn as thin black lines on bare white paper with no background block and no shading, so a full sheet uses a fraction of the toner a shaded worksheet would.

  • Print in black and white. There is no colour on the maze itself, so a colour cartridge buys you nothing. Only the answer key uses a second colour, and it still reads clearly in greyscale.
  • Turn off Fit to page. The maze has already been measured to fill one Letter or A4 sheet with a 12 mm margin. Extra scaling shrinks it and can push it onto a second page.
  • Do not go above 30x30 for hand-solving. On Letter paper a 40x40 maze gives corridors about 4 mm wide. That is fine for a pen but frustrating for a young child with a pencil.
  • Use the PDF for a class set. The PDF is drawn as vector lines, so it stays sharp at any size, and it always includes the answer key as page two. Print page one thirty times and page two once.

If your printer draws faint lines, choose a smaller grid rather than a darker print setting. Fewer squares means thicker walls, which is a paper-side fix rather than a toner-side one.

Ways to use a printed maze in a classroom or at home

A maze is not only a time filler. Tracing a route trains the same visual tracking and fine motor control that handwriting depends on, and the planning it takes to avoid dead ends is early problem solving in a form that does not look like schoolwork.

  • Settling activity: a 10x10 Easier maze takes most infant-age children two or three minutes, which is about the length of a morning register.
  • Fair races: keep the seed fixed and print one copy per child. Everyone gets the identical puzzle, so times are actually comparable. Change the seed and nobody can copy their neighbour, but the difficulty stays level.
  • Early finishers: keep a stack of Harder 25x25 mazes by the door for the children who are done first.
  • Peer marking: print one answer key and hand it to a student to check the rest of the pile.
  • Writing prompt: older children write directions through the maze in full sentences, using left, right, and count-based instructions. It turns a puzzle into a lesson on precise language.
  • A first look at algorithms: for a computing lesson, print the same seed at all three difficulties, put them side by side, and ask what is different. Same size, same rules, three visibly different textures, because three different methods carved them.

Add a name and date line before you print if the sheets are coming back to you. It saves a round of asking whose is whose.

Frequently Asked Questions

Common questions about the Maze Generator

Yes. Each maze is built as a perfect maze, which means there is exactly one route between any two squares, no loops, and no sealed-off pockets. The entrance is always on the left edge and the exit on the right edge, and there is always a single correct path between them. Press Show solution to see it.