ToolsOnline

Sorting Algorithm Visualizer

Step-by-step animations of bubble, selection, insertion, quick and merge sort with live comparison/swap stats

Comparisons
0
Swaps / writes
0
Status
Idle — press Start

About this sorting visualizer

Pick an algorithm and an array size, then hit Start to watch the sort frame by frame: the two bars being compared flash yellow, and every swap or overwrite is drawn as it happens. All five algorithms are implemented as generators that yield compare/swap/write operations one at a time, and the main loop advances a speed-controlled number of steps per frame — pause, resume or shuffle a new array at any time.

The counters below track comparisons and swaps/writes, making it easy to see how an O(n²) bubble sort compares with O(n log n) quicksort or mergesort on the same array. Everything is rendered locally in your browser with zero dependencies — handy for learning, teaching or interview prep.