Skip to main content
Z Sort Visualizer

Quick Sort Visualizer — Animated, Step-by-Step

Animated quicksort with pivot/partition highlights, step controls, speed, custom input, live counters and pseudocode. Runs in your browser.

Free No signup Client-side Privacy friendly Updated
/
Comparisons: Swaps / writes: Array accesses:

Code examples

Ready-to-copy reference implementations. Free to use in your own projects and assignments.

How to use

  1. 1 Press Play to watch each partition place the pivot and split the array around it.
  2. 2 Use Step to advance one comparison at a time and follow the partition pointer.
  3. 3 Type your own numbers into Custom input and press Apply.
  4. 4 Follow the highlighted pseudocode and the live comparison / swap counters.

Why use this tool

  • See how partitioning around a pivot drives the divide-and-conquer recursion.
  • Understand why quicksort is usually the fastest comparison sort in practice.
  • Metrics reveal the O(n²) worst case when pivots split poorly (e.g. sorted input).
  • Runs entirely in your browser. No signup, no uploads.

Frequently asked questions

What is quicksort?

Quicksort picks a pivot, partitions the array so smaller elements go left and larger go right, then recursively sorts each side. This visualizer uses the Lomuto scheme with the last element as pivot.

What is the time complexity of quicksort?

O(n log n) on average, but O(n²) in the worst case when the pivot is consistently the smallest or largest element. Randomized or median-of-three pivots avoid this in practice.

Is quicksort stable?

No. Partition swaps move elements across the array and can reorder equal values. Stable quicksort variants exist but use extra memory.

Why is quicksort so popular?

It sorts in place with good cache behavior and a small constant factor, so it is typically faster than merge or heap sort on real data despite the worst-case bound.

What is Quick Sort Visualizer?

A Quick Sort Visualizer animates the quicksort algorithm: choosing a pivot, partitioning elements around it, and recursively sorting each side. This visualizer uses the Lomuto partition scheme and shows why quicksort averages O(n log n) but can hit O(n²) on poor pivots.

Features

Step-by-step animation

Watch pivot selection, partitioning, and recursion on each subarray.

Complexity

Time: average O(n log n), worst O(n²). Space: O(log n) average. In-place; not stable.

100% private

Runs entirely in your browser — nothing is uploaded.

Example

Input

[5, 2, 8, 1]

Output

choose pivot, partition into < and ≥, recurse → [1, 2, 5, 8] (sorted)

Common use cases

  1. 1

    Understand partitioning

    See how elements are split into < pivot and ≥ pivot.

  2. 2

    Worst-case pitfalls

    Watch a naive pivot on sorted input degrade to O(n²).

  3. 3

    Why it's fast in practice

    See how random or median-of-three pivots avoid the worst case.

Summary

Zerethon's quicksort visualizer animates the divide-and-conquer algorithm in your browser, choosing a pivot, partitioning elements around it, and recursing. Quicksort runs in O(n log n) on average but degrades to O(n²) in the worst case (e.g. a naive pivot on already-sorted input); it uses O(log n) stack space on average, is in-place, and is not stable. Good pivot choice (e.g. median-of-three or random) keeps it fast in practice.

Category
Algorithm
Pricing
Free
Privacy
Browser-based
Signup
Not required

References

Privacy

Your data never leaves your browser unless explicitly stated. Quick Sort Visualizer runs entirely client-side — no server upload, no logging, no tracking of your input.

New to this? Read the step-by-step explanation with Big-O analysis: Learn Sorting Algorithms →

Build, share, and grow on Zerethon Social

Free signup. Earn points, collect achievements, and connect with creators worldwide.

Sign up free