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
- Set the rows and columns, then choose a generation algorithm.
- Press Generate, or change the seed to get a fresh maze with the same settings.
- 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
- Maze generation algorithms, explained
How recursive backtracker, Prim, Kruskal, binary tree and sidewinder each carve a perfect maze, and the texture each one leaves behind.
Related tools
Sudoku Solver
Solve any Sudoku puzzle instantly and generate new ones. Type the grid, get the unique solution, see candidates and clue counts. Runs in your browser.
Magic Square Generator
Generate a magic square of any order, solve a partly filled one, or check if a grid is magic. Odd, singly even and doubly even methods, in your browser.
Truth Table Generator
Generate a truth table from any boolean expression. Supports AND, OR, NOT, XOR, NAND, NOR, XNOR, IMPLIES and IFF. Runs in your browser.
Permutation and Combination Calculator
Calculate permutations (nPr) and combinations (nCr) for choosing r items from n. See both results with the formulas and factorials, updated live.
Annulus Area Calculator
Calculate the area of an annulus, the ring between two concentric circles, from its outer and inner radius. Returns both circumferences and width too. Free.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.