Maze Solver — Find the Shortest Path
Generate a random maze or draw your own, then watch the solver trace the shortest path from the green start to the red finish. Everything runs in your browser, nothing is uploaded.
How to Use the Solver
Hit Random Maze for a fresh maze, or build your own: click a cell to add or remove a wall, and click-and-drag to paint several at once. The green corner is the start and the red corner is the finish. Press Solve and the shortest route lights up in amber, with its length in steps. Clear empties the grid so you can draw a maze from scratch.
How the Solver Works
The solver treats the maze as a grid of open cells and walls and runs a breadth-first search outward from the start, exploring every reachable cell in rings of increasing distance. Because breadth-first search reaches each cell by its shortest route first, the moment it touches the finish it has found the shortest possible path — which it then traces back and highlights. If the finish can't be reached, it says so. It all runs on your device, instantly.
Frequently Asked Questions
How do I use the maze solver?
Can I draw my own maze?
Does it find the shortest path?
What if there's no way through?
Is anything uploaded?
Related Solvers & Puzzles
Want to make and print a maze? Use the Maze Generator. Solving other puzzles? Try the Sudoku Solver or the Sliding Puzzle Solver, or browse all AI solvers & analyzers.
Add This Maze Solver to Your Website
Put the Maze Solver on your own page — free, no sign-up, no watermark. It runs entirely in your visitors' browsers. Copy the snippet and paste it into your page's HTML.