Skip to main content
Particularly LogoParticular.ly

ASCII Maze Generator

Maze Settings
Configure the maze dimensions and appearance
Width: 15 cells
Height: 10 cells
Generated Maze
#############################################
#S #                       #  #     #        #
   ##################                  ###   
#              #        #  #     #        #  #
############      ######   ############      
#     #     #     #  #     #        #     #  #
            ######      ###   ###   ###      
#  #  #  #  #        #  #     #        #  #  #
   ###                        ######   ###   
#     #  #     #  #  #  #  #     #  #     #  #
         ######   ###   ######      ###      
#  #     #  #     #     #     #  #     #  #  #
   ######      ###   ###                     
#  #        #        #     #     #  #  #     #
      ###   ############   ######      ###   
#  #  #              #     #        #  #     #
         #########      ###   #########   ###
#  #  #  #  #     #  #  #           #     #  #
   ###                     ######      ###   
#        #     #        #        #         E #
#############################################

Start at S (top-left), exit at E (bottom-right).

About the ASCII Maze Generator

The ASCII Maze Generator builds random, fully solvable mazes rendered entirely in text characters, using walls, corridors, and a start and exit. You choose the dimensions, and the tool carves a perfect maze where exactly one path connects any two points, guaranteeing there is always a route from entrance to goal with no isolated pockets.

Under the hood, maze generation typically relies on algorithms like recursive backtracking (depth-first search) or randomized Prim's algorithm. These work on a grid of cells, knocking down walls between neighbors as they traverse, which produces the characteristic branching dead ends and a single solution path that defines a perfect maze. Because the output is plain monospaced characters such as pipes, underscores, hashes, or plus signs, it renders identically everywhere a fixed-width font is used.

Common uses include puzzles for printable worksheets, terminal games, programming exercises where students write their own solver, and lightweight content for text-based interfaces, README files, or chat. Smaller mazes are easy to solve by eye, while larger configurations make satisfying brain teasers or test inputs for pathfinding code.

For best results keep the grid modest if you intend to paste into a comment or README, since very large mazes wrap awkwardly on narrow screens. Always view and copy maze output in a monospaced font so the walls align, and if you plan to solve it programmatically, treat wall characters as blocked cells and corridor characters as open ones. Pair it with the ASCII Art Editor if you want to hand-tweak the result.

Frequently asked questions

Are the generated mazes always solvable?
Yes. The generator produces perfect mazes where a single connected path links the start and exit, so a valid solution always exists with no isolated regions.
Why does my maze look misaligned when I paste it?
ASCII mazes rely on a fixed-width (monospaced) font. In proportional fonts the wall characters shift, breaking the grid. Paste into a code block or terminal to preserve alignment.
Can I control how big the maze is?
Yes, the size is configurable. Larger dimensions create harder, more sprawling mazes, while smaller ones are easy to solve by eye and fit neatly into comments or documents.
What algorithm creates the maze?
Random perfect-maze generators commonly use recursive backtracking (depth-first search) or randomized Prim's algorithm, both of which guarantee a single solution path.