Maze generator

This maze generator draws a maze with exactly one way through, with its solution page. Pick a size and press the button for a new maze as often as you like.

Free, no sign-up. Everything runs in your browser; nothing you enter is uploaded.

18 × 20 cells.

Each maze is built so that every path connects and only one route leads from Start to Finish.

18 × 20 cells, one route

Print gives two US Letter pages: the maze, then the solution.

From one page to a finished book

You made one maze. Get the whole maze book.

Say who the book is for, then choose the difficulty and a page count from 24 to 200. In a mixed book the mazes get harder as it goes, the solutions go at the back, and you get the interior and cover as print-ready PDFs.

How to use it

  1. Choose easy, medium or hard.
  2. Press New maze until you like the layout.
  3. Print it, or download the maze and its solution.

A worked example

Choose Medium and press New maze. You get an 18 × 20 maze with Start at the top left and Finish at the bottom right, and a second page with the route drawn in grey.

How the maze generator works

The maze generator starts with a grid in which every cell is walled off, then carves a winding path from cell to cell, knocking down one wall at a time and backing up whenever it reaches a dead end. Because it never breaks into a cell it has already visited, the result is a perfect maze: every cell can be reached, and there is exactly one route between any two points.

That property is what makes a maze fair. There is no shortcut and no second answer, so a dead end is always a dead end. Size sets the difficulty: more cells mean longer false paths before the right one. Use the maze generator for a single worksheet or party activity; a whole maze book needs dozens of different mazes that grow harder, with a solutions section at the back.

Questions

Does every maze have a solution?

Yes, exactly one. The maze is carved as a single connected tree of paths, so one route always exists and no second route can.

Can I use these mazes in a book I sell?

The mazes you generate are yours to use. Check KDP's content guidelines before publishing a book that is only mazes.

How do I get a PDF?

Press Print and choose Save as PDF as the destination. You get the maze on the first page and the solution on the second.

How do I make a whole maze book?

Use the button at the bottom of this page. The maze book generator makes up to 168 different mazes that get harder, adds the solutions and a cover, and exports print-ready files.

Guides

More free tools

Done with the numbers?

Book2Pub plans, illustrates and lays out the interior, then exports a print-ready interior PDF and wrap cover at the sizes these tools calculate.