๐Ÿ•ธ๏ธBFS & DFS Visualizer

Enter a graph, pick a starting node and algorithm, then step through the traversal.

One node per line, "Node: neighbor1, neighbor2". Edges are undirected.

Free BFS & DFS Visualizer

This BFS and DFS visualizer lets you enter any custom graph and step through breadth-first or depth-first traversal one node at a time. BFS explores level by level using a queue (first-in, first-out), visiting all of a node's neighbors before moving further out. DFS explores as deep as possible along each branch using a stack (last-in, first-out) before backtracking.

At each step, you can see which node was just visited, what's left in the queue or stack, and the full visited order building up โ€” useful for understanding exactly how these two fundamental graph algorithms differ in behavior on the same graph. An arrow highlights the edge just traversed, and a plain-language explanation describes what happened at each step for newcomers.

Free, runs entirely in your browser, no sign-up required.