WerklyTools
EN
Buy me a coffee

JavaScript minifier and beautifier

Compress your JS by stripping comments and whitespace and shortening names, or format a minified script so it is readable. Powered by Terser, right in your browser.

Processed 100% in your browser

Output

Ctrl + Enter runCtrl + C copy result

How to use

  1. 1Paste your JavaScript code.
  2. 2Choose Minify or Beautify.
  3. 3When minifying, decide whether to shorten variable names.
  4. 4Copy or download the result.

Use cases

  • Reduce a script’s weight before publishing it.
  • Read a .min.js file to understand what it does.
  • Quickly check whether a snippet has syntax errors.
  • Save bandwidth on small pages without setting up a bundler.

Frequently asked questions

Is it safe to minify with shortened names?

Usually yes, but if your code reaches variables by name (for example via eval or from HTML), turn that option off.

Is my code uploaded to a server?

No. Terser runs in your browser.

Are comments kept?

They are removed when minifying and kept when beautifying.

Does it support modern JavaScript?

Yes, ES2015 and later syntax such as async/await, classes and modules.

Related tools