JavaScript minifier
Minify JavaScript onto one line with Terser: strips comments and spaces, shortens local names and simplifies code.
In your browser
Minified …
Top-level names are left alone, so code that other scripts call (like chart_options) keeps working.
About this tool
Shrink JavaScript for production with Terser, the same minifier used by modern build tools. It shortens local names and simplifies code, and top-level names stay intact.
How to use it
- 1 Paste your JavaScript.
- 2 Choose whether to shorten names and optimise code.
- 3 Copy or download the minified output.
Questions
Will minifying break my code?
Not normally. Top-level names are kept so other scripts can still call them. Test the output before deploying.
Is my data uploaded?
No. This tool runs in your browser, so your text and files never reach our server.
Is this tool free?
Yes. It’s free to use with no sign-up and no limits for normal use.
More in Code & markup
- Chmod calculator New Work out Unix file permissions in octal and symbolic form by ticking boxes.
- Cron expression parser New Explain a cron schedule in plain English and list the next times it will run.
- HTTP status codes New Look up what any HTTP status code means and when to use it.
- JSON to TypeScript New Generate TypeScript interfaces from a sample JSON object.
- Regex tester New Test a regular expression against your text, with matches and capture groups highlighted live.
- BBCode to HTML Convert forum BBCode ([b], [url], [img]…) to HTML.