Merge Sort Visualizer — Animated, Step-by-Step
Animated merge sort with step controls, speed, custom input, live comparison/write counters and pseudocode. Runs in your browser.
Code examples
Ready-to-copy reference implementations. Free to use in your own projects and assignments.
How to use
- 1 Press Play to watch the array split into halves and merge back in sorted order.
- 2 Use Step to advance one merge comparison at a time.
- 3 Type your own numbers into Custom input and press Apply.
- 4 Follow the highlighted pseudocode and the live comparison / write counters.
Why use this tool
- See divide-and-conquer in action: recursive splits, then ordered merges.
- Understand why merge sort guarantees O(n log n) on every input.
- Metrics show the steady comparison count regardless of initial order.
- Runs entirely in your browser. No signup, no uploads.
Frequently asked questions
What is merge sort?
Merge sort recursively splits the array in half until each piece has one element, then merges the pieces back together in sorted order.
What is the time complexity of merge sort?
O(n log n) in the best, average, and worst case. The log n comes from the halving depth and the n from merging each level.
Is merge sort stable?
Yes — when merging, equal elements take the one from the left half first, preserving original order.
What is the downside of merge sort?
It needs O(n) extra memory for the merge buffers, unlike in-place sorts such as heap sort or quicksort.
What is Merge Sort Visualizer?
A Merge Sort Visualizer animates the divide-and-conquer process of merge sort: recursively splitting the array into halves and merging them back in sorted order. It demonstrates the guaranteed O(n log n) running time and stable ordering.
Merge Sort Visualizer is a free algorithm utility by Zerethon Tools. Animated merge sort with step controls, speed, custom input, live comparison/write counters and pseudocode. Runs in your browser. Runs entirely in the browser — no signup, no upload.
- Category
- Algorithm
- Pricing
- Free
- Privacy
- Browser-based
- Signup
- Not required
Privacy
Your data never leaves your browser unless explicitly stated. Merge Sort Visualizer runs entirely client-side — no server upload, no logging, no tracking of your input.
Related tools
Bubble Sort Visualizer
Animated bubble sort with step controls, speed, custom input, live comparison/swap counters and pseudocode. Runs entirely in your browser.
Open toolInsertion Sort Visualizer
Animated insertion sort with step controls, speed, custom input, live comparison/write counters and pseudocode. Runs in your browser.
Open toolSelection Sort Visualizer
Animated selection sort with step controls, speed, custom input, live comparison/swap counters and pseudocode. Runs in your browser.
Open toolQuick Sort Visualizer
Animated quicksort with pivot/partition highlights, step controls, speed, custom input, live counters and pseudocode. Runs in your browser.
Open toolBuild, share, and grow on Zerethon Social
Free signup. Earn points, collect achievements, and connect with creators worldwide.