Menu
Dev Tools

JavaScript Minifier & Beautifier Online Free

Minify JavaScript using Terser or beautify with js-beautify. Shows compression ratio. Browser-based.

Files never storedInstantNo signup

🔒 Your file never leaves your browser. All processing runs locally using Terser.

How to Minify JavaScript Online

  1. 1

    Paste your JavaScript

    Paste your JavaScript code in the input box.

  2. 2

    Click Minify or Beautify

    Minify compresses using Terser. Beautify formats the code with consistent indentation.

  3. 3

    Copy the result

    Click Copy to copy the processed code to your clipboard.

JavaScript is usually the heaviest part of a page — not just to download but to parse and execute. Unlike CSS minification, which only strips whitespace, a real JavaScript minifier rewrites your code: local variables become single letters, dead branches are eliminated, and expressions are collapsed into shorter equivalent forms. That is why JS routinely compresses 30–60%, far more than markup or styles.

Powered by Terser: this tool runs Terser — the same minifier used internally by Webpack, Vite, and Rollup — compiled to run entirely in your browser. You get production-grade output without installing Node or configuring a bundler, which is handy for one-off scripts, code you paste into a CMS, or quick size checks.

What stays safe: exported names, string contents, and anything reachable from outside the file are never renamed. The edge cases to know about: code that reads function.name at runtime, or stack-trace parsing, can behave differently after mangling — keep a source map or an unminified copy for debugging.

Beautify mode reverses the process for readability: paste minified vendor code and get consistent indentation back (though original variable names are gone for good — renaming is one-way). Pair this with the CSS minifier and JSON formatter when you are slimming down a whole deployment.

Frequently Asked Questions

Related Dev Tools