Big O Time Complexity Calculator
Estimate operation counts and runtime for a complexity class at a given input size.
About Big O Time Complexity Calculator
Complexity classes describe how cost grows rather than absolute speed. Comparing runtime at n and at ten times n shows the practical difference: linear grows tenfold while quadratic grows a hundredfold. An algorithm that is fast at small input can be unusable at scale, which is why growth rate matters more than constant factors once data volumes grow.
Formula
Big O Time Complexity
Operations = f(n) for the complexity class; runtime = operations × time per operation
- n
- Input size
- growth function
- How operation count rises with n
Worked example
With the default values below, Big O Time Complexity Calculator returns Estimated Runtime of 3.3219. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Input size nminimum 1
- 10,000
- Complexity classone of O(1) constant, O(log n) logarithmic, O(n) linear, O(n log n) linearithmic, O(n squared) quadratic, O(n cubed) cubic, O(2 to the n) exponential
- O(n log n) linearithmic
- Nanoseconds per operationminimum 0.001 ns
- 25 ns
Results
- Estimated Runtime
- 3.3219 ms
- Estimated Operation Count
- 132,877
- Estimated Runtime
- 0.003322 s
- Runtime if n Grows Tenfold
- 41.5241 ms
- Scaling Verdict
- Scales acceptably — roughly proportional to input
Step by step
- 1Values used
- 2Big O Time Complexity
- 3Estimated Runtime= 3.3219 ms
- 4Estimated Operation Count= 132,877
- 5Estimated Runtime= 0.003322 s
- 6Runtime if n Grows Tenfold= 41.5241 ms
- 7Scaling Verdict= Scales acceptably — roughly proportional to input
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is Big O Time Complexity calculated?
Operations = f(n) for the complexity class; runtime = operations × time per operation Complexity classes describe how cost grows rather than absolute speed. Comparing runtime at n and at ten times n shows the practical difference: linear grows tenfold while quadratic grows a hundredfold.
Why does Big O Time Complexity matter?
An algorithm that is fast at small input can be unusable at scale, which is why growth rate matters more than constant factors once data volumes grow.
What values do I need to enter?
This calculator takes 3 inputs: Input size n, Complexity class, Nanoseconds per operation. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
