What is a Sorting Algorithm Visualizer?
A sorting algorithm visualizer shows how an array changes while an algorithm sorts it. Each step highlights comparisons, swaps, placements, or partitions so you can connect the code with the visible result.
This tool supports bubble sort, insertion sort, selection sort, merge sort, and quick sort.
For related interactive algorithm tools, browse the Data Structure Visualizers hub.
How to use this sorting visualizer
- Paste an array such as
[8, 3, 6, 1, 9, 2, 5]. - Choose a sorting algorithm.
- Click Generate steps.
- Use Previous and Next to move through the algorithm.
- Compare the note, highlighted bars, and current array at each step.
Which sorting algorithm should I compare first?
Bubble sort, insertion sort, and selection sort are simple places to start because their comparisons and swaps are easy to follow. Merge sort and quick sort are more efficient on larger inputs and show divide-and-conquer behavior.
If you want to compare array sorting with pointer-based array patterns, use the Sliding Window Visualizer and Two Pointers Visualizer. For tree or graph traversal, use the Binary Tree Visualizer and Graph BFS DFS Visualizer.