AZ Tools

Maze Generator (SVG / PNG)

Random

Pick a grid size (up to 60×60), cell pixel size, and a numeric seed. The tool runs a recursive-backtracking depth-first search to carve a perfect maze (exactly one path between any two cells) and renders it as SVG. Start cell is green, end cell is red. Toggle the solution overlay to see the BFS-shortest path drawn in blue, and download as a sharp SVG or a 2× PNG for printing on a worksheet, party game card, or escape-room handout.

How to use

  1. Set the grid width and height (4-60) and the cell size in pixels.
  2. Pick a seed manually or click 'New seed' for a fresh maze.
  3. Toggle 'Show solution' to verify difficulty, then download as SVG (vector) or PNG (2× rasterized for printing).

Frequently asked questions

What is a 'perfect maze'?
A maze with exactly one path between any pair of cells — no loops, no isolated regions. Recursive-backtracking always produces a perfect maze and tends to create long, winding corridors with relatively few branches, which feels harder for kids than other algorithms (Prim's, Kruskal's, Wilson's).
Why use a seed?
The same seed + same size always produces the same maze. Lets you share a specific maze with someone (the seed is in the filename), reprint it later, or A/B compare difficulty.
Why does the solution look fairly direct?
Recursive-backtracking biases toward long corridors. The shortest path will be relatively direct compared to other algorithms — but the dead-ends are plentiful, which is what makes solving without the overlay tricky.
Can I get a circular or hexagonal maze?
Not from this tool — only rectangular grids. Circular and hexagonal mazes need different topologies and rendering, which would be a separate tool.

Related tools