← All Tools

Big O Complexity Comparator

Compare common algorithmic complexities at any input size. Pick an n, choose how many operations per second your machine handles, and see how each curve scales — and exactly when your code stops fitting in a single frame, request, or coffee break.

Inputs

n scale:
Machine:

Show curves

Operations & runtime at n = 1000

Frame budget (60fps): 16.67 ms HTTP request: ≈100 ms Tea break: 5 min

Growth chart

Operations vs. input size on a log–log plot. Steeper line = faster growth = bigger trouble at scale.

Where these show up

O(1) — Hash table lookup, array index, stack push.

O(log n) — Binary search, balanced BST find, heap insert/pop.

O(n) — Single pass: Array.map, linear search, sum reduce.

O(n log n) — Merge sort, quicksort (avg), FFT, comparison sort lower bound.

O(n²) — Nested loop, bubble/insertion sort, naive matrix-vector multiply.

O(n³) — Naive matrix multiplication, Floyd–Warshall shortest paths.

O(2ⁿ) — Brute-force subset enumeration, naive recursive Fibonacci, SAT solving.

O(n!) — Brute-force traveling salesman, generate all permutations.