Algorithm Visualizer
Visualize sorting algorithms (Bubble, Merge, Quick Sort, and more) with animated bar charts.
Bubble Sort — Complexity
| Best | Average | Worst | Space | Stable |
|---|---|---|---|---|
| O(n) | O(n²) | O(n²) | O(1) | Yes |
All Algorithms — Quick Reference
| Algorithm | Best | Average | Worst | Space | Stable |
|---|---|---|---|---|---|
| Bubble Sort | O(n) | O(n²) | O(n²) | O(1) | Yes |
| Selection Sort | O(n²) | O(n²) | O(n²) | O(1) | No |
| Insertion Sort | O(n) | O(n²) | O(n²) | O(1) | Yes |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) | Yes |
| Quick Sort | O(n log n) | O(n log n) | O(n²) | O(log n) | No |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) | No |
About Algorithm Visualizer
Watch sorting algorithms come to life with animated bar-chart visualizations. Choose from Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, and Heap Sort. Control array size, animation speed, and array type (random, nearly sorted, reversed, few unique values). Step through frames one at a time or let it play automatically. View live comparison/swap counters and a full time/space complexity reference table.
How to Use
- 1Select an algorithm from the dropdown.
- 2Choose an array type and adjust the size and speed sliders.
- 3Click Play to start the animation, or Step to advance one frame at a time.
- 4Watch the bars animate — colors indicate the current operation.
- 5View live comparisons and swaps in the stats bar above the chart.
- 6Check the complexity tables below for time and space complexity details.
Frequently Asked Questions
Which algorithms are supported?
What do the bar colors mean?
Can I step through frame by frame?
What is the Speed slider controlling?
What is the Array type setting?
Tool Info
- Category
- dev
- Usage
- Unlimited
Related Tools
More dev tools
JSON Formatter
Format, validate, and beautify JSON data.
Base64 Encode/Decode
Encode text to Base64 or decode Base64 to text.
Encoder / Decoder
Encode & decode text with 15+ formats: Base64, URL, Hex, Binary, Morse, ROT13, JWT, SHA-256 and more.
GitHub Repository Scanner
Visualize any public GitHub repo: file tree, stats, README, and contributors.