Maze Maker — Generate, Play & Print Mazes Free

A maze is already drawn below. Change the size, the algorithm or the shape and it rebuilds instantly, play it with the arrow keys, then print it with its answer key. Every maze is a perfect maze: exactly one path between any two cells.

5 × 5 to 60 × 60 3 algorithms 7 shapes Answer key SVG + PNG export

Maze maker

0 cells 0 dead ends 0 step solution 0 moves 0:00

A preset sets the grid size and the algorithm together.

20 × 20 cells

The seed is written into the URL, so a reload — or a shared link — restores this exact maze.

Printable maze pages

Each page has its own pre-built maze, its measured stats, printing notes for that audience and a printable answer key.

How the maze maker works

The grid is a graph: one node per cell, one edge per pair of cells that share a side (or, in the circular maze, a ring boundary). A maze is a spanning tree of that graph. A spanning tree on N cells has exactly N − 1 edges and no cycles, which is the definition of a perfect maze — one route between any two cells, no loops, no unreachable pockets.

  1. Pick a shape. Rectangles use four-sided cells. Circles use concentric rings, where a cell can open inward, outward, clockwise or anticlockwise. Masked shapes (heart, star, tree, pumpkin, leaf) start from a rectangle and delete the cells outside the silhouette.
  2. Pick an algorithm. A recursive backtracker carves long corridors, Prim's algorithm grows a bushy tree with many short dead ends, and Kruskal's produces an even texture with no directional bias.
  3. Play it. Arrow keys or WASD move the dot; a finger drag draws a path that snaps to the grid. A move is only accepted when the two cells are actually joined, so a wall can never be crossed.
  4. Print it. One, two or four mazes per page, each on its own seed, plus an optional answer-key page with the shortest path drawn in. The printout is pure vector SVG.

The start is the cell nearest the top-left of the shape (the centre for circular mazes) and the finish is the cell furthest from it along the maze, so the solution is never a two-step cop-out. Both are marked with dots, and the measured solution length is shown above the board before you start.

Nothing leaves the browser. Generation, solving, printing and exporting use only the JavaScript already on the page; there is no upload, no account and no third-party script.

Frequently asked questions

Is this maze maker really free?

Yes. Generating, playing, printing and exporting mazes are all free, with no account, no download limit and no paywall. The site carries no advertising code.

What is a perfect maze?

A maze in which there is exactly one route between any two cells: no loops and no isolated areas. Every generator here builds a spanning tree, so every maze on the site is perfect by construction rather than by luck.

How do I print a maze with its answer key?

Leave "Include answer key page" ticked and press Print. The worksheet prints first and the key follows on its own page with the shortest path drawn through each maze. Choose "Save as PDF" in the print dialog to keep a copy.

Can I print several different mazes on one sheet?

Yes. Set mazes per page to 2 or 4. Each slot uses a different seed, so the mazes on one sheet are genuinely different puzzles rather than copies.

How does the circular maze work?

The circle shape is a polar grid: a centre disk surrounded by rings of sector cells. Movement is inward, outward, clockwise or anticlockwise, and the walls are arcs and radial segments instead of straight lines.

Can I share a maze with someone else?

Yes. The URL hash records the shape, algorithm, size, seed and line width. Copy the address from the bar and the same maze opens for anyone who follows it.

Does it work on a phone or tablet?

Yes. The board is touch-driven: drag a finger along a corridor and the path follows, snapping to cells. The layout has no horizontal scrolling at 390 pixels wide.

Can I use the printed mazes commercially?

The mazes are generated geometry, not licensed artwork, so you can print and redistribute them. Shapes are generic outlines; no character, logo or brand appears anywhere on the site.