Algorithm Running Time Calculator (Big O)
Pick a complexity and input size to see how long the algorithm would run.
Your numbers
Your results
Algorithm Running Time Calculator (Big O) by TheCalcTools
How the Algorithm Running Time Calculator (Big O) works
Big O describes how the number of operations grows with input size, ignoring constant factors. This calculator assumes exactly that many simple operations at the speed you enter.
Real programs have constants, caches and memory effects, so treat results as orders of magnitude. The point is the growth: O(n²) at a million items is a trillion operations.
The formula
Worked example
Using the default values shown in the calculator:
| Time complexity | O(n log n) |
|---|---|
| Input size n | 1e+06 |
| Operations per second | 1e+09 |
- O(n log n) for a million items: about 19930000 operations, or 0.0199 seconds.
Result:
| Estimated time | 0.0199 seconds |
|---|---|
| Operations | 19930000 |
| Time if n grows 10× | 0.233 seconds |
Frequently asked questions
Why does O(2ⁿ) explode?
Each extra item doubles the work: n = 60 is already about 10¹⁸ operations.
Sources and further reading
Related calculators
More in AI & Computing · All calculators
This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.
