Time Complexity Calculator

Enter an input size n and instantly see the exact operation count for each Big-O complexity class in a side-by-side comparison table.

Calculate Operation Counts

Enter an input size n to see how many operations each complexity class requires.

Factorial capped at n = 20 due to numeric limits.

Operation Counts for n = 100

Sorted fastest to slowest
Complexity Class name Operations Approx. Feasibility

Multi-n Comparison

* Values shown as approximate counts. Factorial and exponential capped at n = 20.

Summary

Enter an input size n and instantly see the exact operation count for each Big-O complexity class in a side-by-side comparison table.

How it works

  1. Enter an input size n (up to 10,000 for polynomial classes; capped at 20 for exponential and factorial).
  2. The calculator evaluates each Big-O formula — 1, log2(n), n, n×log2(n), n², 2^n, n! — for that n.
  3. Each row shows the exact operation count with a color-coded feasibility label.
  4. Compare the classes side by side to judge which algorithms stay practical at your data size.

Use cases

  • Estimate whether a brute-force O(n²) approach is fast enough before optimizing.
  • Decide between O(n log n) merge sort and O(n²) insertion sort for a given dataset size.
  • Determine at what n an exponential-time algorithm becomes computationally infeasible.
  • Quickly calculate exact operation counts during algorithm design and code review.
  • Teach Big-O trade-offs by showing concrete numbers side-by-side.

Frequently Asked Questions

Last updated: 2026-06-11 · Reviewed by Nham Vu