Puzzles & Party

Maze Generator

A fresh maze every time, from a quick 8×8 for little kids to a 60×60 monster. Play it right here with the arrow keys or your finger, or print it out with the answer on a second page.

⏱ 0.0 s👣 0
Keeps this tool on this device so it works without internet, even after a refresh.

Had fun, or did this help? I’d appreciate any donation :) Not needed, but money buys temporary happiness at least lol

What it is

A maze generator that makes a brand new, always-solvable maze whenever you press the button. Every maze is "perfect": there's exactly one route from the start to the exit and no loops, so you can't cheat by going round in circles. Play it on screen, or print it for a rainy day.

Example

A 15×15 maze has 225 cells and 224 openings between them. That's the rule for every perfect maze: one fewer opening than cells, which is exactly enough to join everything with no loops. The solution can be anything from about 25 steps (lots of short dead ends) to well over 100 (long winding paths), and the generator shows its length when you reveal it.

How to play

  1. Move the blue dot from the green start to the red exit. In square mazes that's top left to bottom right. In round mazes you start in the middle and escape through the gap in the outside wall.
  2. On a computer use the arrow keys or WASD, or drag with the mouse. On a phone, drag your finger along the path, or use the arrow buttons under the maze. In round mazes, up moves toward the centre, down moves outward, and left and right go around.
  3. The timer starts with your first move. Stuck? Show the solution.

How the mazes are made

"Long winding paths" uses a depth-first search (recursive backtracker): it wanders from cell to cell, knocking down walls, and only backs up when it hits a dead end, which makes long twisty corridors. "Lots of short dead ends" uses Prim's algorithm, which grows the maze outward from many points at once and makes a bushier maze with lots of short branches. Round mazes use the same idea on rings of cells.

Maze Generator FAQ

Can I print mazes for a class?

Yes. Print makes a page with the maze and a second page with the solution. Press New maze for another one. Everything is free to use.

Is anything uploaded?

No. Mazes are made in your browser, and only your best times are saved, in this browser's local storage.