Paste your code to inspect its structure, count common programming constructs, and get a rough complexity hint. Works best as a quick heuristic—not a substitute for a proper algorithm analysis.
Your code is analyzed in this browser and is not uploaded by this tool. Counts are heuristic and may not understand every language syntax or comment format.
Analysis Result
Lines of Code (non-empty)0
Characters0
Functions / Methods0
Loops0
Conditions0
Max Nesting Estimate0
Estimated time complexity hint: Unable to estimate
This is a pattern-based hint from loop structure. It cannot reliably determine Big-O for arbitrary code, recursion, library calls, data-dependent loops, or all syntax variations.
Use this Code Complexity Estimator to quickly review the structure of pasted source code. It counts non-empty lines, functions, loops, conditions, and an approximate nesting depth, then provides a cautious complexity hint.
What Is Code Complexity?
Code complexity describes how an algorithm or program behaves as its input grows, or how difficult its logic may be to understand and maintain. Time complexity is commonly expressed using Big-O notation such as O(1), O(n), or O(n²).
How This Estimator Works
Counts non-empty lines and characters.
Looks for common function or method declarations.
Detects common loop keywords and conditional statements.
Estimates nesting using braces or indentation-like patterns.
Provides a rough time-complexity hint based on detected loop patterns.
Understanding Big-O Notation
O(1) — constant time
O(n) — linear time
O(n²) — quadratic time
These are common growth-rate categories. The estimator's result is not a formal proof: accurate Big-O analysis requires understanding what each loop does, how many times it runs, and whether operations depend on input size.
Limitations
This tool uses text patterns rather than a full parser or compiler. It can miscount constructs in comments, strings, unusual syntax, recursion, comprehensions, or nested function calls. Treat the result as an educational starting point and verify important conclusions manually.
Privacy
Analysis is performed locally in your browser. The code you paste is not sent to a server by the estimator. If you save a history item, it stores only summary metrics and the language selection in this browser's local storage—not your source code.
Technologies Used
Built with HTML, CSS, and JavaScript. No account or installation is required.