Skip to main content
Z

A* Pathfinding Visualizer — Interactive, Heuristic Search

Interactive A* pathfinding on a grid with a Manhattan heuristic — draw walls, move start/goal, generate mazes, step through the search. 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 Draw walls by clicking and dragging; drag the green start or red goal to reposition them.
  2. 2 Press Play to watch A* head toward the goal using its distance heuristic.
  3. 3 Use Maze for instant obstacles, or Step through node by node.
  4. 4 Notice how few cells A* visits compared with Dijkstra or BFS.

Why use this tool

  • See how the Manhattan heuristic pulls the search straight toward the goal.
  • A* finds the shortest path while exploring far fewer nodes than uninformed search.
  • Toggle between this and the Dijkstra / BFS visualizers to compare exploration.
  • Runs entirely in your browser. No signup, no uploads.

Frequently asked questions

What is the A* algorithm?

A* (A-star) is a best-first pathfinding algorithm that orders the frontier by f = g + h, where g is the cost from the start and h is a heuristic estimate of the cost to the goal.

What heuristic does this visualizer use?

The Manhattan distance (|Δrow| + |Δcol|), which is admissible on a 4-directional grid — it never overestimates, so A* is guaranteed to find the shortest path.

What is the time complexity of A*?

In the worst case O(E log V) like Dijkstra, but with a good heuristic it explores dramatically fewer nodes in practice.

When is A* better than Dijkstra?

Whenever you have a single goal and a useful heuristic. A* focuses the search toward the goal; Dijkstra explores in all directions equally.

What is A* Pathfinding Visualizer?

An A* Pathfinding Visualizer animates the A* search algorithm on a grid. A* orders its frontier by f = g + h (cost so far plus a Manhattan-distance heuristic), so it explores toward the goal and finds the shortest path while visiting far fewer cells than uninformed search.

Features

Step-by-step animation

Watch the open set expand toward the goal, guided by f = g + h.

Complexity

Heuristic-dependent (worst case exponential); admissible heuristic → optimal path. Space: O(V).

100% private

Runs entirely in your browser — nothing is uploaded.

Example

Input

grid with start, goal, obstacles

Output

expand lowest f = g + h toward goal → optimal path (with an admissible heuristic)

Common use cases

  1. 1

    Grid pathfinding

    Find the shortest route around obstacles in games and maps.

  2. 2

    Heuristics vs Dijkstra

    See how a good heuristic makes A* explore fewer nodes than Dijkstra.

  3. 3

    Admissibility & optimality

    Learn why an admissible heuristic guarantees the optimal path.

Summary

Zerethon's A* pathfinding visualizer animates the A* search on a grid in your browser, expanding nodes in order of f = g + h (cost-so-far plus a heuristic estimate to the goal). With an admissible heuristic A* finds an optimal path while typically exploring far fewer nodes than Dijkstra. Its running time depends on the heuristic (exponential in the worst case); space is O(V) for the open and closed sets.

Category
Algorithm
Pricing
Free
Privacy
Browser-based
Signup
Not required

References

Privacy

Your data never leaves your browser unless explicitly stated. A* Pathfinding Visualizer 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