📊 Sorting Algorithm Visualizer

Watch six classic sorting algorithms race on the same shuffled data — see exactly why O(n²) sorts crawl while merge and quick sort fly. Every comparison and swap is counted live.

Pick an algorithm and press Start.
What you're seeing

Each bar is one value. Bubble/insertion/selection compare neighbours again and again — O(n²) — so their comparison counts explode as the list grows. Merge, quick and heap sort divide and conquer — O(n log n) — and finish in a fraction of the work. The gold bars are the two being compared right now; green means that position is final.