Boneyard Tools

Maze Generator and Solver

Build a printable maze at any size, pick the algorithm that shapes its corridors, and let the solver trace the shortest way out. Every maze is driven by a seed, so the same settings always rebuild the exact same maze, and you can copy it as box-drawing ASCII art.

How to make a maze

  1. Set the rows and columns, then choose a generation algorithm.
  2. Press Generate, or change the seed to get a fresh maze with the same settings.
  3. Toggle the solution to reveal the shortest path, or copy the maze as ASCII art.

Examples

Generate a 20 by 20 maze

rows = 20, cols = 20, algorithm = recursive-backtracker
a perfect maze with one path between any two cells, plus its solution

Frequently asked questions

What is a perfect maze?

A perfect maze has exactly one path between any two cells, with no loops and no closed-off areas. All five algorithms here build perfect mazes, which is why the solver always finds a single unique route from start to finish.

Which generation algorithm should I pick?

Recursive backtracker makes long winding corridors with few junctions. Prim and Kruskal feel more open and branchy. Binary tree and sidewinder are fast and have a visible diagonal bias, which makes them good for teaching how the methods differ.

How does the seed work?

The seed feeds a deterministic random number generator, so the same size, algorithm and seed always rebuild the identical maze. Share a seed and anyone can recreate your exact maze, or change it to roll a new one.

Can it add loops to the maze?

Yes. Braiding removes a share of the dead ends by opening one extra wall at each, which adds loops and gives the maze more than one possible route. The solver still finds the shortest path through the result.

Is my maze sent to a server?

No. Generating, solving and rendering all run entirely in your browser, so nothing is uploaded anywhere.

Learn more

Related tools