Tested tool guide
Tested browser tools
Checked August 16, 2026
What Sorting Algorithm Visualizer does, with a checked example
Paste an array of numbers, or let the tool generate one, pick an algorithm from the five offered - bubble, merge, quick, heap, radix - and watch the sort run. The array renders as bars whose heights match the values, each step lights up the elements being compared or swapped, and swap totals tick up as the bars reorder. Running two algorithms side by side on identical input makes their personalities obvious: quicksort jumps across the array, bubble sort shuffles neighbors one position at a time, merge sort visibly assembles from halves. The surprise: the most visually frantic algorithm is rarely the one with the fewest swaps, and neither predicts runtime.
Worked example
A concrete input and expected output from the current implementation.
Input
7, 2, 9, 4 with bubble sort selected
->
Expected output
Sorted: 2, 4, 7, 9. The animation logs 3 swaps - 7 with 2, then 9 with 4, then 7 with 4 - and stops after a quiet pass finds nothing to swap.
Bubble sort walks the array swapping adjacent pairs that are out of order, and the list has exactly three inversions - (7,2), (7,4), (9,4) - so three swaps remove them all. The passes themselves need six comparisons (three, then two, then one), which is why the animation keeps scanning even after the array looks sorted.