Generator · Print-true
Maze maker
Make a printable maze with its answer key on the next page. Choose the grid, the dead ends, the paper and the margin, then print the maze or save it as a PDF. The route from the entrance to the exit is guaranteed to exist, and the key draws it. The maze is carved in your browser at true page size, with no watermark and no account, and nothing is uploaded.
Adjust
Details
How this generator works
Everything on the sheet is drawn in millimeters, and the cell size is the measurement that matters. The page starts from the physical sheet (215.9 by 279.4 mm for US Letter, 210 by 297 mm for A4), takes your margin off all four sides, takes off the title band and the two narrow rows that carry START and FINISH, and divides what is left by the columns and rows you asked for. Columns and rows each run from 3 to 50, and a number outside that range is brought inside it with a note saying so. Cells are square, so the smaller of the two divisions wins, and the maze is centered in the space that remains. The Details panel below the sheet shows the cell size and the clear width left between two walls once the wall thickness is subtracted. Nothing is rescaled afterwards: the SVG viewBox is the physical page in millimeters, so a cell that reads 9.52 mm measures 9.52 mm on paper.
The maze is carved by a randomized depth-first walk over the grid. The walk steps into a random unvisited neighbor and knocks down the wall between the two cells; when there is nowhere new to go, it backs up and tries again. A seeded generator drives it, so a given seed, grid and paper always carve the same maze. The walk keeps its trail on an explicit stack in an array, because the largest grid offered here is 2500 cells and a recursive call stack that deep is not safe to rely on. Since the walk never enters a cell twice, its passages reach every cell without closing a single loop, which makes them a spanning tree of the grid. Breadth-first search then finds the solution in the same array of passages the sheet is drawn from, so the puzzle and the key cannot disagree. The entrance and the exit are gaps cut in the border above the top-left cell and below the bottom-right one, and the drawn route runs out through both.
A practiced solver can finish any perfect maze by filling in dead ends: follow each corridor to where it stops, cross it off, and repeat. The braided settings open dead ends to stop that tactic. A braided maze has several routes, and its key draws the shortest, labeled "shortest route" in the corner stamp where a perfect maze says "the only route". Small cells are the other limit. At 30 columns on Letter portrait the clear corridor is already down to 5.9 mm, and under 5 mm a felt tip and a young hand start to fight the paper, so the page warns at 5 mm and shows an error under 3.5 mm. Print at 100% or "Actual size": "Fit to page" rescales the sheet, and the cell size in the readout then no longer matches the paper.