Algorithm Visualizer (Sorting + Searching)
Watch algorithms work step-by-step. This tool visualizes common sorting algorithms and binary search with speed control, single-step playback, and counters for comparisons, swaps, and writes. Export a clean PNG report when you’re done.
Controls
Generate an array, build steps, then play/pause or step through.
Algorithm report snapshot
Algorithm Visualizer
Bubble sort • step 0 / 0
Comparisons
0
Swaps
0
Writes
0
This is an educational visualization. Runtime depends on array size and algorithm.
What is an algorithm visualizer?
An algorithm visualizer turns abstract steps into a concrete animation. For sorting, each bar represents a value in an array. Algorithms compare values and move them into order. For searching, binary search repeatedly halves the search range until it finds a target or proves it isn’t present.
Sorting: comparisons, swaps, and writes
Sorting algorithms are often analyzed by the number of comparisons and the number of element moves (swaps/writes). Bubble sort is simple but inefficient on large arrays. Merge sort is efficient and stable but uses additional memory. Quicksort is typically fast in practice but can degrade on certain patterns depending on pivot choice.
Searching: binary search requires sorted data
Binary search is fast because it eliminates half the remaining range each step. The key requirement is that the array must be sorted. This tool sorts your input before stepping through binary search, then highlights low/high/mid positions as it narrows the range.
This tool runs entirely in the browser and stores your last-used settings in localStorage for convenience (clearing site data removes that history).