All toolsA* Visualizer

Developer tool

A* (A-Star) Visualizer

Watch A* combine movement cost and a Manhattan-distance heuristic to find a lowest-cost path with less exploration.

Search
Board
Speed
Edit grid

About this tool

How A* explores

A* ranks candidate cells by both the cost already traveled and an estimate of the distance remaining. On this four-direction grid, the Manhattan-distance heuristic guides the search toward the goal without sacrificing optimality.

Create a weighted detour and compare A* with Dijkstra's. Both find the same lowest-cost path here, while A* often expands fewer cells before it reaches the goal.

How it works

Try this visualizer

  1. 1Set up the grid

    Draw walls or weighted cells, then place the start and goal nodes.

  2. 2Run the algorithm

    Use A* to study heuristic search, game pathfinding, and efficient weighted routing.

  3. 3Compare the outcome

    Use the links above to run another algorithm against the same kind of map.

Common questions

A* Visualizer FAQ

Can I draw my own obstacles?

Yes. Choose Wall, Weight, Erase, Move start, or Move goal, then drag across the grid before running the selected algorithm.

Do weighted cells change every algorithm?

Weighted cells change the displayed path cost for every run, but only Dijkstra's and A* use those costs when choosing their route.

Does the visualizer run in my browser?

Yes. The grid and every search run stay in your browser; nothing you draw is uploaded or stored.