Skip to content
Toolbench

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. 1 Paste your JavaScript.
  2. 2 Choose whether to shorten names and optimise code.
  3. 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.