Random Maze Generator

Carve a fresh maze with exactly one way through -- three sizes, printable, with the solution one press away.

About this generator

Every press carves a brand-new maze -- enter at the top-left, escape at the bottom-right -- in your choice of three sizes, from a quick 10×10 to a properly stubborn 24×24. Each maze is 'perfect' in the technical sense: every corridor is reachable and there is exactly one path through, revealed on demand by the Show solution button.

Every result here is drawn using crypto.getRandomValues() -- the Web Crypto API's cryptographically secure randomness -- instead of Math.random(), so it's genuinely unpredictable, not just statistically random. Learn more.

What people use it for

Parents and teachers generate them as printable puzzles and quiet-time activities; puzzle fans race them on screen. The unique-solution guarantee also makes them useful as small logic exercises -- and the seed number means a specific maze can be recreated for everyone to race fairly.

How it works

Each press draws a 32-bit seed from the site's cryptographically secure randomness, then carves passages with a recursive-backtracker walk: it wanders from cell to cell knocking down walls, backing up whenever it hits a dead end, until every cell has been visited. That construction makes the maze a tree, which is what guarantees exactly one path between entrance and exit -- the same path the Show solution button draws in purple. Same seed and size, same maze, every time.

Common questions

Is there always a way through?

Always exactly one -- the carving method visits every cell and never creates loops, so a single path connects the top-left entrance to the bottom-right exit, with every dead end a deliberate distraction.

How do I see the answer?

Press "Show solution" under the maze and the one true path is drawn in purple; press again to hide it and keep struggling honorably.

Can I print a maze?

Yes -- the maze is drawn as crisp vector lines, so printing the page (or screenshotting it) stays sharp at any size. Generate, hide the solution, and print.

What do the difficulty levels change?

The grid: Easy is 10×10, Medium 16×16, Hard 24×24. More cells mean longer corridors, more dead ends, and a solution path that's much easier to lose.

Related Generators

Coat of Arms · Mandala · Game of Life · Langton's Ant · Fractal · Walk Art

All Pattern generators

Browse all generators