All toolsBFS Visualizer

Developer tool

BFS Visualizer

Watch Breadth-First Search expand outward one layer at a time and find the fewest-step path on an unweighted grid.

Search
Board
Speed
Edit grid

About this tool

How BFS explores

Breadth-First Search explores every reachable cell at the current distance before moving to the next layer. Its expanding frontier makes the reason for its fewest-step guarantee easy to see on an unweighted grid.

Add walls to make the frontier bend around obstacles, then compare the result with the other visualizers. BFS deliberately ignores weighted cells, so use Dijkstra's or A* when movement costs differ.

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 BFS to study unweighted shortest paths, maze solving, and level-by-level graph traversal.

  3. 3Compare the outcome

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

Common questions

BFS 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.