DevTools Hub

Search tools

Search for a developer tool

Algorithms

Algorithm Runtime Estimator

Turn a complexity class and input size into real hours, days, and years.

Part of the Algorithms Toolkit
O(n²) at n = 1,000,0001.00 × 10^12 operations, at 100,000,000 ops/sec
2.78 hours
Milliseconds10,000,000
Seconds10,000
Minutes167
Hours2.78
Days0.1157
Years3.17 × 10^-4

What this calculates

Pick a complexity class, an input size, and a processing speed, and this converts the resulting operation count into actual wall-clock time — milliseconds up through years. Big O notation tells you how an algorithm scales; it doesn't tell you whether that scaling is fine or catastrophic at the size you actually care about. This does that second part. The default example is a real one: an O(n²) algorithm over a million records, at a typical single-core speed, comes out to roughly 2.8 hours — a number that's easy to miss when all you've looked at is the notation.

The formulas, exactly

Operation count divided by operations/sec gives seconds; every other unit is a straight conversion from there, using a 365.25-day year (the standard astronomical convention) so the years figure stays accurate over long spans instead of drifting.

Why O(2ⁿ) doesn't just show a huge number

At n in the hundreds, 2ⁿ already exceeds what a 64-bit float can represent — it would overflow to Infinity long before becoming a useful answer. Every calculation here is done in log₁₀ space instead of computing the raw operation count directly, so results stay precise and finite no matter how large the input, and get shown in scientific notation (3.16 × 10^42 years, for example) once they're past the point a plain number would even be meaningful.

FAQ

What does the age-of-the-universe comparison mean?

For results that land at over roughly 13.8 billion years, this compares the estimate directly to the current age of the universe as a multiple, since "years" alone stops being an intuitive unit well before that point. Below that, and above a human lifetime, it compares to an average 80-year lifespan instead — different anchor, same idea: turning an abstract huge number into something you can actually feel.

Is this exact?

It's an order-of-magnitude estimate, not a benchmark. Real hardware has cache effects, branch prediction, memory bandwidth limits, and constant factors this doesn't model — the operation count itself is exact for the given formula, but converting it to wall-clock time always depends on how fast a single "operation" actually runs on real hardware. Use the operations/sec presets as a starting point and adjust to match your own measured throughput for anything you actually need to plan around.

Where do these complexity classes come from?

See Algorithm Complexity Explained for the formal definitions, Big O Calculator for exact operation counts at a few input sizes at once, and Complexity Visualizer for these same classes plotted as continuous growth curves.

Is anything I enter sent anywhere?

No — every calculation happens entirely in your browser. Nothing you enter here is ever sent to a server.

Related tools