1. Home
  2. Developer tools
  3. Big-O Calculator

Big-O Calculator

Turn Big-O notation into seconds and years, to see why a nested loop is fine for 100 items and hopeless for a million.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Big-O Calculator

  1. Enter the input size n and the operations per second.
  2. Pick the complexities to compare.
  3. Read the time table and the growth chart.

Features

  • Eight complexity classes from O(1) to O(n!)
  • Operation counts and human-readable times
  • Log-scale growth chart
  • Table for n from 10 to one billion
  • Adjustable machine speed

Supported formats

Input

  • Form input

You get

  • Screen view

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Big-O Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Times are orders of magnitude; real performance depends on constants, memory access and hardware.

Guide

What Big-O notation means in seconds, hours and years

Big-O notation describes how the work an algorithm does grows as its input grows. It is the language of algorithm courses, interviews and code reviews, but the notation alone hides how dramatic the differences are. This calculator turns each complexity class into an operation count and a time estimate for the input size and machine speed you choose.

What Big-O describes

O(f(n)) says that, for large inputs, the running time grows no faster than f(n) times some constant. Constants and lower-order terms are dropped, so an algorithm doing 3n² + 10n steps is simply O(n²). That makes Big-O ideal for comparing how algorithms scale, and useless for predicting the exact speed of one implementation on one machine.

The eight classes

O(1) is constant: a hash table lookup or reading an array element. O(log n) halves the problem each step, as binary search does. O(n) touches every item once, like a linear scan. O(n log n) is the cost of efficient sorting such as merge sort and heap sort. O(n²) appears with nested loops over the same data, as in comparing every pair, and O(n³) with triple loops such as naive matrix multiplication. O(2ⁿ) comes from trying every subset, and O(n!) from trying every ordering, as brute-force route planning does.

From operations to time

Choose how many simple operations per second the machine performs; a modern CPU core manages very roughly hundreds of millions to a few billion simple operations, depending on what counts as an operation. The tool divides each class’s operation count by that speed and prints the result in nanoseconds up to years. When the number exceeds the age of the universe, about 13.8 billion years, it says so.

Chart and table

The chart plots the selected classes for inputs from 1 to 64 on a logarithmic scale, the only way to fit constant and exponential growth on the same picture. The second table keeps the machine speed and runs the selected classes for inputs from ten to one billion, showing where each one stops being practical: n² is fine at ten thousand and hopeless at a billion.

A worked example

With n = 100,000 and 100 million operations per second, O(1) takes 10 ns and O(log n), about 17 operations, 166 ns. O(n) needs 1 ms and O(n log n), 1,660,964 operations, 16.6 ms. O(n²) needs 10,000,000,000 operations and 1.67 minutes, O(n³) 116 days, and both O(2ⁿ) and O(n!) are “longer than the age of the universe”. That is the difference between a sort and a nested loop over the same 100,000 records.

What Big-O hides

Constants matter for real inputs. An O(n log n) algorithm with heavy overhead can lose to a simple O(n²) one for small n, which is why library sorts switch to insertion sort for short runs. Memory access often matters more than operation counts: scanning an array in order is many times faster than chasing pointers through a linked list with the same complexity. Measure with real data before optimising.

Using it in reviews and interviews

When you propose an algorithm, state its complexity and the input size you expect, then show the time from the table. “O(n²) on 50,000 rows is about 25 seconds at this speed” is a far stronger argument than the notation alone.

Checked against the current version of the Big-O Calculator on .

Frequently asked questions

What is the difference between Big-O, Big-Omega and Big-Theta?

Big-O is an upper bound on growth, Big-Omega a lower bound and Big-Theta both at once. In everyday use, people say O(n log n) when they mean the tight bound Θ(n log n), and the calculator follows that everyday meaning.

Is a hash table lookup really O(1)?

On average, yes: the time does not grow with the number of entries. The worst case, when many keys collide, is O(n), and resizing occasionally costs O(n) too, which is why it is called amortised constant time.

Is O(n log n) really much faster than O(n²)?

For large inputs, enormously. At a million items, n log n is about 20 million operations and n² is a trillion, a difference of 50,000 times. For a few dozen items the constant factors matter more than the class.

What does log n mean without a base?

In Big-O the base does not matter, because changing it only multiplies by a constant. This tool uses log₂, the usual choice for binary search and divide-and-conquer algorithms.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.