← back to Mathematics

Sorting Visualizer

Watch bars get sorted by bubble, selection, insertion, merge and quick sort, with step counters. Race mode: guess which algorithm is faster.

Why does the way we sort matter?

Computers sort all the time: contact lists, search results, high scores. There are many ways to do it, and they are not equally fast. Bubble, selection and insertion sort are easy to understand but need a huge number of steps when there is a lot of data. Merge sort and quick sort split the problem into small pieces, so they save many steps on big data. Try race mode with 40 bars and see the difference!

tags: #sorting algorithms #bubble sort #quick sort #computer science

Compare two neighbours and swap them if they are in the wrong order. Big ones "bubble" to the right.

steps 0 · compares 0 · moves 0

Amber = being compared. Keyboard: space run/pause, N one step.

How to install the app

This browser has not offered an automatic install button yet. Install it from the browser menu:

Android (Chrome)
Tap the ⋮ menu at the top right, then choose "Install app" or "Add to Home screen".
iPhone / iPad (Safari)
Tap the Share button (the square with an up arrow), then choose "Add to Home Screen". On iOS this only works in Safari.
Computer (Chrome / Edge)
Click the install icon (a monitor with a down arrow) at the right end of the address bar, or menu ⋮ → "Install Daily Apps".