Numbers
Maze Generator
A maze generator builds a grid-based labyrinth using a depth-first search carve algorithm, the same approach used in classic maze-generation software. Starting from a single cell, the algorithm digs a path into a random unvisited neighbor, backtracking whenever it hits a dead end, until every cell in the grid has been visited exactly once. Because every cell connects back to the start through exactly one path, the result is always a perfect maze: there is one and only one route between the start (S) marked in the top-left corner and the end (E) marked in the bottom-right corner, with no loops and no isolated pockets. Walls are drawn with # characters and open paths with blank spaces, so the maze reads cleanly on screen or pasted into a monospaced font for printing. Three sizes are available: small renders an 8×8 grid of cells, medium renders 12×12, and large renders 16×16, each producing a bigger and more winding maze as the grid grows. Every maze includes a solve-time estimate line so you know roughly what you're getting into before tracing a path with a pencil or your cursor. Generate up to three mazes in a single batch, which is useful for printing a set of worksheets, running several rounds of a puzzle activity, or picking whichever layout looks the most interesting. Because the algorithm is randomized, no two mazes come out the same, even at the same size.
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Choose a maze size — small, medium, or large — based on how much time you want the puzzle to take.
- Set the count field to how many mazes you want generated in one batch, up to three.
- Click generate and read the maze from the S in the top-left corner toward the E in the bottom-right.
- Trace your path through the blank spaces, using the # walls to guide which turns are available.
- Check the solve-time estimate line under each maze to gauge the difficulty before you start.
- Generate again for a completely new layout at the same size if you want another round.
Use Cases
- •A teacher building a quiet warm-up activity prints three small mazes for students to solve at the start of class
- •A parent preparing a party favor packet generates a handful of medium mazes to print alongside coloring pages
- •A puzzle hobbyist wants a fresh large maze to solve by hand every morning with coffee
- •A game designer prototyping a dungeon layout uses the ASCII grid as a quick placeholder map before building real level art
- •A developer testing a maze-solving pathfinding algorithm needs a batch of guaranteed-solvable grids to run test cases against
Tips
- →Print the maze in a fixed-width font like Courier so the walls line up correctly.
- →Work backward from the E if you get stuck near the start — many mazes are easier to trace in reverse.
- →Use the small size for quick five-minute breaks and the large size when you want a puzzle that takes real concentration.
- →Generate a batch of three mazes if you're running a group activity so everyone gets a slightly different layout.
- →Mark your path lightly in pencil first, since backtracking is common even in a maze with only one true solution.
- →Time yourself against the solve-time estimate to see how your pace compares to the generator's guess.
FAQ
is every maze actually solvable
Yes. The generator carves the maze with a depth-first search, which visits every cell exactly once and leaves behind a single connected path between start and end. There are no disconnected sections and no dead ends that trap you permanently — every wrong turn is just a dead end you can backtrack out of.
How big is a large maze?
Large renders a 16×16 grid of cells, which becomes a 33×33 character grid once walls are added between each cell. That is big enough to take a few minutes to solve by hand and still prints clearly on a standard sheet of paper in a monospaced font.
can I generate more than one maze at once
Yes, set the count field to 2 or 3 to generate multiple mazes in a single run. Each one uses an independent random carve, so you get different layouts even at the same size.
Why does the maze look different every time I generate at the same size?
The carving algorithm picks a random unvisited neighbor at each step, so the exact route through the grid changes every run. The grid dimensions stay fixed for a given size, but the walls and path are always freshly randomized.
what do the S, E, #, and blank spaces mean
S marks the entrance in the top-left corner and E marks the exit in the bottom-right corner. The # character is a wall you cannot pass through, and a blank space is an open path you can walk along to get from S to E.
You might also like
Popular tools from other categories that share themes with this one.
Try these next
More free tools from other corners of the catalog, picked by shared themes.