Maze Generator

Create printable mazes in any size. Download as PDF with answer key included.

Click Generate to create your maze.

Can't find what you need?

Request a Tool

How to Use the Maze Generator

  1. Set the size. Use the Rows and Columns sliders to control how large your maze will be. A 10x10 maze is quick and easy; a 40x40 maze is a serious challenge. Both sliders go from 5 to 50.
  2. Choose an algorithm. Recursive Backtracker creates long, winding corridors with few dead ends. Prim's produces a more branchy, organic feel. Kruskal's generates uniform texture with many short paths. Each produces a structurally distinct maze.
  3. Adjust wall thickness and theme. Thin walls work well for large grids; thick walls suit smaller, bolder mazes. Themes add a decorative border style to the page.
  4. Generate. Click "Generate Maze" to create a unique maze. Click again to get a different layout with the same settings.
  5. Download. The ZIP includes US Letter and A4 PDFs, each with a puzzle page and a separate answer key showing the solution path highlighted in teal. Use "Generate Batch PDF" to produce multiple unique mazes in a single file, ideal for classroom packets or activity books.

About the Maze Generator

This tool generates perfect mazes, meaning every cell is reachable and there is exactly one solution path from start to finish. The three generation algorithms each have a distinct character. The recursive backtracker (DFS) tends to produce long winding corridors, making it feel harder than it is. Prim's algorithm produces mazes with a more organic branching structure. Kruskal's algorithm builds mazes by merging disjoint sets of cells, resulting in a more statistically uniform distribution of passage lengths.

All mazes are solved internally using BFS, so the answer key always shows the shortest correct path. Mazes render at 300 DPI for crisp print quality. Everything runs in your browser and nothing is uploaded to any server.

Frequently Asked Questions

What is the difference between the three maze algorithms?

Recursive Backtracker (DFS) creates long, winding paths with relatively few junctions, so solvers tend to follow one corridor a long time before backtracking. Prim's algorithm grows the maze outward from a seed cell, producing many short dead-end branches and a more open texture. Kruskal's algorithm randomly removes walls while keeping all cells connected using a union-find structure, resulting in a maze with a balanced, uniform passage-length distribution. For kids or beginners, Prim's tends to be easiest to navigate; for experienced solvers, Kruskal's provides a more consistent challenge.

Can I use these mazes for commercial products like Etsy downloads or activity books?

Yes. The mazes you generate are yours to use however you like, including selling them as printable downloads, including them in puzzle books for Amazon KDP, or distributing them as classroom materials. The small "foundthetool.com" footer credit can be cropped if needed for commercial use.

What is included in the batch PDF and the ZIP download?

The ZIP download contains four files: a US Letter PDF and an A4 PDF, each with a puzzle page followed by an answer key page. The answer key highlights the correct solution path in semi-transparent teal. The batch PDF generates the number of unique mazes you selected (5 to 50), all on US Letter size, with all puzzle pages first followed by all answer key pages. Each maze in a batch is generated with a different seed, so no two are identical.