Skip to content
Toolbench

Minify JavaScript

Minify JavaScript with Terser: remove comments and whitespace and shorten names. Free, in your browser.

In your browser

Minified …


        

Top-level names are left alone, so code that other scripts call (like chart_options) keeps working.

Also with the javascript minifier

About this tool

Shrink a JavaScript file for production. Comments and whitespace are removed, local names are shortened and code is simplified, all in your browser.

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.