Algomination
Data Structures
AboutContact

Algomination

Learn algorithms and data structures through smooth, interactive visualizations.

SortingSearchingArray AlgorithmsData StructuresAboutContact

© 2026Algomination. Created by Omang Rawat & Rahul Soni.

Omang Rawat
Rahul Soni
All sorting algorithms

Merge Sort

Time O(n log n)Space O(n)

Recursively splits the array, then merges sorted halves back together. Stable, O(n log n).

Up to 8 numbers — each level shows the array split in half, then merged back sorted.

8
3
5
1
9
2
7
4
Start with the whole array of 8 elements.
Step 1 / 60
MergingComparingPlaced / sorted

About Merge Sort

Recursively splits the array, then merges sorted halves back together. Stable, O(n log n).

Time complexity: O(n log n). Space complexity: O(n).

How it works, step by step

Core idea — Recursively split the array in half until each piece is a single element, then merge halves back together in order.

What each pass accomplishes — Each merge fuses two already-sorted sub-arrays into one bigger sorted sub-array. Working up the tree, the sorted runs double in size every level until the whole array is one sorted run.

Use the interactive visualizer above to run Merge Sort on your own input and watch every comparison, swap, and operation animate step by step — pause, scrub, or replay at any speed.