Printable maze generator with solution

Make a printable maze from 5 by 5 to 60 by 60 cells, pick its style, show the solution and save a PDF or SVG. Runs on your device.

How it works

  1. Pick a difficulty or set the columns and rows
  2. Choose a maze style and a seed, then press New maze for another
  3. Download the PDF with answer key, or the SVG

How the maze generator works

The generator builds a perfect maze: every cell can be reached and there is exactly one route from the entrance in the top left to the exit in the bottom right. Pick a preset or set the columns and rows between 5 and 60, choose a style, and the maze appears at once. Press Show solution to draw the route in colour. Press New maze for a different one. The seed box holds a word or number, and the same seed with the same size and style always gives the same maze, so you can reprint a maze later or share the seed with someone else. The PDF has one maze per page, up to 10, followed by the same mazes with the solution drawn as an answer key.

Maze styles and difficulty

Three methods are offered. Long corridors uses a recursive backtracker, a random walk that never stops until it is boxed in, so it makes long winding passages with few dead ends. Many short dead ends uses randomised Prim, which grows from a frontier of walls and makes a bushy maze with many small branches. Mixed uses randomised Kruskal, which removes walls at random only when they join two separate regions. The presets pair a size with a style: Kids is 8 by 8, Easy 12 by 12, Medium 20 by 20, Hard 35 by 35 and Expert 60 by 60. Bigger mazes take longer to solve, but a bushy maze is often easier to read than a corridor maze of the same size.

How the solution is found

The solution is the shortest route found by breadth-first search from the start cell to the finish cell. Because the maze is a spanning tree, with one fewer passage than it has cells, there is only one route without turning back, so the shortest route is the only route. The stats show the size, the number of dead ends and the length of the solution in cells. A 15 by 15 maze has 225 cells and 224 passages. Walls are drawn as merged straight lines, so the SVG and PDF stay small and sharp at any print size.

Printing and privacy

Choose Letter or A4 paper. Each maze is scaled to fill the page inside a margin of 48 points, which is two thirds of an inch, so large mazes use thin lines; a 60 by 60 maze on Letter has cells under 9 points wide and passages are narrow. For wide passages use the Kids or Easy preset, which print cells about 64 and 43 points wide. The maze is built in your browser. Your settings, including the seed, are saved on this device so the page reopens on your last maze, and nothing is sent anywhere.

Frequently asked questions

How do I make a printable maze?

Choose a preset such as Medium (20 by 20), press Download PDF, and print. The PDF has the maze on page 1 and the same maze with the solution drawn on the next page. Set Mazes in the PDF to 10 for a full worksheet pack.

What does the seed do?

It fixes the random choices. The seed 1 with a 15 by 15 size and the Long corridors style always gives the same maze, on any device. Change the seed, or press New maze, for a different one. Write the seed down to reprint a maze later.

Which maze size is right for young children?

Start with 8 by 8 (Kids) or 12 by 12 (Easy) in the bushy style. They have 64 and 144 cells, and on Letter paper each cell prints about 64 and 43 points wide, so the passages are wide and the dead ends short. Medium (20 by 20) has 400 cells at about 26 points, Hard (35 by 35) has 1225 cells at about 15 points, and Expert (60 by 60) has 3600 cells at under 9 points.

Is there always a solution, and only one?

Yes. Every maze here is a perfect maze, a spanning tree of cells with no loops and no sealed-off areas. With 225 cells in a 15 by 15 maze there are exactly 224 passages. You can only go wrong by entering a dead end, never by looping.

Can I save the maze as an image?

Download SVG saves a sharp vector image you can open in a browser or drawing program and resize freely. A PNG is not offered; open the SVG and export it or take a screenshot if you need one. The Show solution button decides if the SVG includes the route.

How big can a maze be?

From 5 by 5 up to 60 by 60 cells, which is 3600 cells. Columns and rows can differ, such as 30 by 20, and the PDF fits the maze to the page. Circular mazes are not offered.