Big O Complexity Analyzer
Estimate time and space complexity in 14 languages with confidence and evidence. Syntax trees for JS, TS and Python; bounded heuristics for other languages.
Source Code
Analysis method: Syntax-tree analysis
Limit: 200 KiB, 10,000 lines. Code is never executed. 0 bytes · 0 lines
Paste code or load an example, then select Analyze complexity.
Complexity Report
Results appear here after you analyze code.
Analysis runs locally in a browser worker. Source code is not uploaded, executed or sent to AI services. The draft and language may be kept in this browser until you reset.
How to use
- 1.Choose a language, paste a function or script and select Analyze complexity.
- 2.Pick a function from the scope list, select a finding to highlight its lines, compare growth curves, then copy the report or download Markdown or JSON.
Big O Complexity Analyzer
Estimate time and space complexity of JavaScript, TypeScript and Python code with syntax-tree static analysis, confidence levels and line-by-line explanations.
How the analysis works
JavaScript, TypeScript and Python use syntax trees. Other languages use bounded token and block inspection, not a full grammar. Estimates assume integer loop counters and unit-cost arithmetic. Unresolved calls, callbacks, macros, unusual syntax and unproven termination produce uncertainty; memory for allocations and sorting is unknown. No code is executed.
Limits and confidence
Results are estimates, not proofs. Dynamic dispatch, unknown library calls, input-dependent recursion, amortized behavior, concurrency, I/O and reflection lower confidence. Limits: 200 KiB, 10,000 lines, 50,000 syntax nodes, nesting depth 200 and a 5-second analysis budget.
Privacy
Analysis runs locally in a browser worker. Source code is not uploaded, executed or sent to AI services. The draft and language may be kept in this browser until you reset.
Frequently asked questions
- How accurate is the Big O estimate?
- It is a static estimate. Common loop, recursion and library patterns get High or Medium confidence; anything the analyzer cannot model, such as unknown calls or dynamic dispatch, lowers confidence or is reported as Unknown instead of being guessed.
- Which languages are supported?
- JavaScript, TypeScript and Python. Each is parsed with a real grammar into a syntax tree, so complexity is not inferred by counting loop keywords.
- Does it detect recursion?
- Yes, for simple direct recursion. Decrementing, halving and divide-and-conquer recurrences are estimated with their recursion stack shown separately; mutual recursion and memoization reduce confidence.
- Is my code uploaded or executed?
- No. Code is parsed in a Web Worker in your browser, never executed, uploaded or sent to AI services. Only the draft and language may be saved in browser storage on this device.
