Time Complexity Calculator
Analyze time and space complexity of your algorithm. Paste code or pseudocode and get instant Big O notation with detailed explanation.
Quick Patterns
What is Time Complexity?
Big O Notation describes how the running time or memory usage of an algorithm grows relative to the input size n. It focuses on the dominant term and ignores constants.
Time complexity measures the number of operations performed. A single loop is O(n); two nested loops are O(n²); divide-and-conquer algorithms like binary search are O(log n).
Space complexity measures the additional memory your algorithm uses. Iterative solutions often need O(1) extra space, while recursive ones consume O(n) stack space.
How to Use This Tool
1Choose a quick pattern preset or paste your own code.
2Click "Analyze Complexity" to run the heuristic analysis.
3Review the detected time and space Big O notation.
4Read the explanation to understand the detected patterns.
5Expand the reference table to compare all common complexities.