Magic Number Finder
Find unexplained numeric literals in code and replace them with named constants. Free and private: runs in your browser.
Paste code to list every magic number with its line. 0, 1, -1, 2 and 100, constant declarations and enum values are ignored.
Runs entirely in your browser. Nothing you paste is uploaded or stored.
Use cases
- Check a function before opening a pull request.
- Explain a review comment with numbers instead of opinions.
- Find the riskiest code to refactor first.
Frequently asked questions
Why are magic numbers bad?
A bare 0.175 or 86400 hides its meaning and is easy to change in one place but not another. A named constant like VAT_RATE or SECONDS_PER_DAY documents intent.
Is the Magic Number Finder free?
Yes. It is free with no sign-up, and it runs entirely in your browser, so your input is never uploaded or stored.
How accurate is a browser-based code check?
It uses fast heuristics on the snippet you paste, so it is great for quick feedback. For whole repositories, cross-file analysis and history, run a full CodeInspector scan.
Related tools
Track complexity, duplication and code smells across your whole codebase with CodeInspector.