Skip to main content
Z

Maze Generator — Animated Recursive Division

Animated maze generator using recursive division — step through the wall carving, adjust speed, regenerate. Pairs with the pathfinding visualizers. Runs in your browser.

Free No signup Client-side Privacy friendly Updated

Move the indigo token with / WASD (or tap an adjacent cell) from the green start to the red goal. Walls block you.

Moves: Time: 🎉 Reached the goal!
/

Pseudocode

How to use

  1. 1 Press Generate to watch the maze build with recursive division.
  2. 2 Use Step to add one wall at a time and follow the recursion.
  3. 3 Press New maze for a different random layout.
  4. 4 Adjust Speed to slow the carving down for study.

Why use this tool

  • See recursive division split each chamber with a wall and a single gap.
  • Every maze it produces is "perfect": exactly one path between any two cells.
  • A great companion to the pathfinding visualizers — the same grid model.
  • Runs entirely in your browser. No signup, no uploads.

Frequently asked questions

How does recursive division generate a maze?

It starts with an open area, then recursively splits each chamber with a straight wall that has a single random gap, repeating until the chambers are too small to divide.

What is a "perfect" maze?

A maze with exactly one path between any two cells — no loops and no isolated regions. Recursive division always produces a perfect maze.

Can I solve the maze?

Yes — copy the layout into the BFS, Dijkstra, or A* visualizers (same grid) to watch an algorithm find the path through it.

What other maze algorithms exist?

Recursive backtracker (randomized DFS), Prim’s, Kruskal’s, Wilson’s, and Eller’s — each produces mazes with a different visual texture.

What is Maze Generator?

A Maze Generator builds a random maze by recursive division: it repeatedly splits each chamber with a wall that has a single gap until the chambers are too small. The result is a "perfect" maze with exactly one path between any two cells.

Features

Animated generation

Watch walls get carved as the algorithm walks the grid.

Complexity

O(cells) time and space; produces a perfect maze (unique path between any two cells).

100% private

Runs entirely in your browser — nothing is uploaded.

Example

Input

grid size (e.g. 10×10)

Output

a perfect maze — exactly one path between any two cells

Common use cases

  1. 1

    Generate maze puzzles

    Create random mazes to solve or print.

  2. 2

    Test pathfinding

    Produce grids to run BFS/DFS/A* against.

  3. 3

    Learn spanning trees

    See how a perfect maze is a spanning tree of the grid graph.

Summary

Zerethon's maze generator builds a random perfect maze in your browser — one with exactly one path between any two cells (no loops, no isolated regions) — using algorithms like randomized depth-first search. Generation visits each cell once, running in O(cells) time and space.

Category
Algorithm
Pricing
Free
Privacy
Browser-based
Signup
Not required

References

Privacy

Your data never leaves your browser unless explicitly stated. Maze Generator runs entirely client-side — no server upload, no logging, no tracking of your input.

New to this? Read the step-by-step explanation with Big-O analysis: Learn Graph Algorithms →

Compare

Related tools

Build, share, and grow on Zerethon Social

Free signup. Earn points, collect achievements, and connect with creators worldwide.

Sign up free