Watch sorting algorithms run, step by step
Hit a problem, or wish a tool existed?
Tell us what went wrong while using this tool, or suggest a new free tool — we aim to build new tool ideas within 2 days.
Contact usPick an algorithm
Choose from Bubble, Selection, Insertion, Merge, Quick, or Heap sort.
Set speed & array size
Tune how fast it runs and how many elements to sort.
Watch it sort
Follow color-coded comparisons, swaps, and the final sorted result.
See exactly how six classic sorting algorithms work, one comparison and swap at a time — Bubble, Selection, Insertion, Merge, Quick, and Heap Sort, the same ones most CS courses and coding interviews cover. Pick an algorithm and a starting array — Random, Nearly Sorted, Reverse Sorted, or Few Unique Values, to see best-case and worst-case behavior directly instead of just reading about it — then adjust the array size (10 to 150 elements) and animation speed and watch it sort live. Each algorithm gets its own color-coded view: the element currently being compared, the current best candidate or pivot, and the region already confirmed sorted are all shown distinctly as it runs, alongside running comparison and swap counts, an elapsed-time clock, and the algorithm's best, average, worst-case, and space complexity. It's real JavaScript running step by step, not a pre-recorded animation, so what you see is exactly what the algorithm actually does.
Bubble Sort, Selection Sort, Insertion Sort, Merge Sort, Quick Sort, and Heap Sort — the six most commonly taught in computer science courses and asked about in coding interviews.
Yes — best, average, worst, and space complexity for the selected algorithm, plus live comparison count, swap count, and elapsed time as it actually runs, so the theory and the real behavior show side by side.
Bubble Sort, Insertion Sort, and Merge Sort are stable — equal elements keep their original relative order. Selection Sort, Quick Sort, and Heap Sort are not, since they swap elements across the array in ways that can reorder equal values.
Merge Sort if stability and a guaranteed O(n log n) matter more than memory use; Quick Sort if average-case speed on large, randomly-ordered data matters more. Interviewers often want you to justify the choice based on the specific input, not just name the fastest one.
Quick Sort's worst case is O(n²), and this implementation picks the last element as the pivot each time — an already-sorted or reverse-sorted array is exactly the input that triggers that worst case. Merge Sort's O(n log n) holds regardless of input order, which is why it stays consistent.
A comparison is every time the algorithm checks one value against another to decide what to do next. A swap is every time two values actually change places in the array. Watching both together shows why, for example, Selection Sort does far fewer swaps than Bubble Sort on the same input, even with a similar number of comparisons.
Anywhere from 10 to 150 elements, adjustable with the size slider — regenerate a new random array at any size before starting.
Yes — the speed slider goes from a slow, step-by-step pace up to a fast run, so you can either follow every comparison or watch the overall pattern emerge quickly.
Entirely in your browser — nothing is uploaded, and the algorithms run as real, unmodified JavaScript, not a pre-recorded animation.
Yes — it's built around the six algorithms most commonly covered in CS courses and asked about in interviews, with the same time/space complexity figures you'd find in a textbook, shown alongside the algorithm actually running so the abstract numbers connect to real behavior.
A tool that shows a sorting algorithm running step by step on a bar chart instead of just describing it in words — each comparison and swap plays out visually and in real time, so you can see exactly how the algorithm reaches a sorted result rather than just reading pseudocode.
Yes — sorting is one of the core topics in any DSA course or interview, usually one of the first algorithm families taught, since it introduces ideas like time and space complexity that apply everywhere else in the subject.
Broadly two families: comparison-based sorts — like the six here, which work by comparing pairs of elements — and non-comparison sorts, like Counting Sort or Radix Sort, which exploit specific properties of the data instead. Comparison-based sorting has a proven lower bound of O(n log n) in the general case; non-comparison sorts can beat that under the right conditions.
On average, both are O(n log n) and close in practice — Quick Sort is often slightly faster in real-world use due to better cache behavior and lower constant factors, but Merge Sort guarantees O(n log n) even in the worst case, while Quick Sort's worst case is O(n²).
Bubble Sort — it's just repeatedly comparing neighboring pairs and swapping them if they're out of order, which is why it's usually taught first, even though it's rarely the right choice once the input gets large.
Sorting arranges a collection into a specific order, like these six algorithms do. Searching finds whether — and where — a specific value exists within a collection. The two are related: many fast search algorithms, like binary search, only work correctly on data that's already sorted.
Yes — the algorithm logic is language-agnostic. The same comparisons and swaps shown here are exactly what Bubble Sort, Quick Sort, and the others do in Java, Python, C++, or any other language; this visualizes the algorithm itself, not one language's implementation of it.
Yes — the Array dropdown offers Random, Nearly Sorted, Reverse Sorted, and Few Unique Values, so you can directly watch best-case and worst-case behavior instead of just reading about it in a complexity table.
Comprehensive token tool to decode, verify, and generate JWT (JSON Web Tokens) and PASETO (Platform-Agnostic SEcurity TOkens) instantly. View header, payload, and signature sections with syntax-highlighted JSON. Generate new tokens with custom payloads. Perfect for developers debugging authentication tokens, API tokens, and bearer tokens. Features instant real-time decoding as you type, support for both JWT and PASETO token formats, token generation with custom algorithms (HS256, HS384, HS512), three-part visualization showing header/version, payload, and signature/footer separately, color-coded JSON syntax highlighting for easy reading, one-click copy to clipboard for each section, and complete client-side processing for maximum security. All token processing happens entirely in your browser - tokens are never transmitted to any server, ensuring complete privacy and security. Supports all standard JWT formats and PASETO v2/v4. Ideal for debugging authentication flows, inspecting API tokens, generating test tokens, understanding token structure, validating token claims, and learning about modern authentication. No installation or registration required.
Compare two texts side-by-side with color-coded highlighting for additions, deletions, and modifications. Supports line-by-line, word-level, and character-level comparison modes. Perfect for code review, document comparison, and tracking changes.
Search up to 5 words or phrases simultaneously with color-coded highlighting, occurrence counters, and easy navigation — no browser extension to install. Warns you if two search boxes have the same term, and when two terms' matches overlap, the earlier one wins so highlighting never looks broken. Perfect for analyzing documents, finding patterns in large texts, and reviewing content with multiple search terms at once.
Format, validate, and beautify JSON data instantly. Minify JSON, fix formatting errors, and validate JSON syntax online. Perfect for developers working with APIs and configuration files.