Generator · Print-true
Maze maker
A printable maze with a route that is guaranteed to exist, and an answer key on the next page that shows it. Choose the grid, the paper and the margin; the maze is carved in your browser at true page size, with no watermark, no account, and nothing uploaded.
How this generator works
Everything on the sheet is a millimeter measurement, and the cell size is the one 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. Cells are square, so the smaller of the two divisions wins and the maze is centred in the space that remains. That number, and the clear width still open between two walls once the wall thickness is subtracted, are both printed in the readout strip above. 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 itself is carved by a randomised depth-first walk over the grid — step into a random unvisited neighbour, knocking down the wall between the two; when there is nowhere new to go, back up and try again — driven by a seeded generator, so the same seed with the same grid and paper reproduces the same maze permanently. The walk runs on an explicit stack rather than by recursion, because the largest grid offered here is 2500 cells and a call stack that deep is not a thing to depend on. Because the walk never enters a cell twice, the passages it leaves behind form a spanning tree of the grid: every cell reachable, no loops anywhere, and exactly one simple path between any two cells. The solution is then found by breadth-first search over that same array of passages rather than over a second model of the maze, which is the reason the puzzle and the key cannot disagree with each other. 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 of them.
The honest limits. A perfect maze has no loops and exactly one solution, which is what makes an answer key meaningful — and it is also what makes it easier for a practised solver, because dead ends are then the only obstacle, so filling them in (follow each corridor to where it stops, cross it off, repeat) finishes any perfect maze mechanically. The braided settings exist for exactly that reason and they cost you uniqueness: several routes then exist, the key prints the shortest of them, and the sheet stamps itself "shortest route" rather than "the only route" so the two are never mistaken. Second, small cells. 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 begin to fight the paper; the page warns at 5 mm and refuses under 3.5 mm rather than printing something nobody can trace. Third, the one thing no generator can control from outside the print dialog: print at 100% or "Actual size". "Fit to page" rescales the sheet, and then the cell measurement in the readout is not the cell measurement on your desk.