Pathfinding Visualizer
Draw walls and watch A*, Dijkstra, BFS and more find a path, or race two.
Algorithms
Pathfinding Visualizer
Sorting Algorithm Visualizer
Graph Algorithms Visualizer
Questions
What is the difference between A* and Dijkstra?
Both find the cheapest path. Dijkstra spreads out evenly by cost in every direction. A* adds a guess of the distance left to the end, so it leans towards the goal and usually explores far fewer cells. Race them to see it.
Why does breadth-first search pick an expensive path?
BFS counts steps, not cost, so it finds the path with the fewest moves even if it crosses costly cells. Dijkstra and A* add up the costs instead.
Why is greedy best-first so fast but sometimes wrong?
It always moves to the cell that looks closest to the end and never reconsiders. That is quick in open space, but a wall in the way can send it on a long detour.
How do I draw?
Click or drag to draw walls, and drag S or E to move them. Pick "Cost 5" as the brush to paint expensive cells. Or press Edit as text and type the grid: S start, E end, # wall, . open, 2-9 cost.
Can I share a maze?
Yes. Share copies a link with the grid in it, and the page opens with that grid.
Related tools
- Sorting Algorithm VisualizerWatch quicksort, merge sort and more sort your numbers, and race two side by side.
- Attention CalculatorScaled dot-product attention step by step: scores, softmax weights and output.
- IEEE 754 Float InspectorThe bits and exact value of any float or double, such as 0.1 + 0.2.
- Base ConverterBinary, octal, decimal and hex, all at once.