compress

JS Minifier

Minify JavaScript by removing comments and collapsing whitespace, with a live before-and-after size comparison. Ideal for inline scripts and small files. Runs entirely in your browser.

compress

About JavaScript Minifier

Strips comments and collapses whitespace to reduce payload size. This is a lightweight minifier; for production-grade output use a bundler. Pair it with theCSS Minifier andHTML Minifier.

shield_lock

Secure & Private Client-Side

This tool runs entirely in your browser. No data is sent to any server, ensuring your information remains private and secure.

About JS Minifier

Minify JavaScript by removing comments and collapsing whitespace, with a live before-and-after size comparison. Ideal for inline scripts and small files. Runs entirely in your browser.

Frequently Asked Questions

Is this a production-grade minifier? expand_more

No. This is a lightweight minifier that strips comments and whitespace. For mangling, dead-code elimination, and tree-shaking use a bundler like esbuild, Rollup, or Terser.

Will minification break my code? expand_more

It can if you rely on ASI (automatic semicolon insertion) or have comments that affect behavior. Always test the minified output.

Can I minify CSS and HTML too? expand_more

Yes. Use the [CSS Minifier](/tools/css-minifier/) and [HTML Minifier](/tools/html-minifier/) for those formats.

How much can I save? expand_more

Typically 30-60% on hand-written code, less on already-optimized bundles. The savings panel shows the exact percentage.

Is my code uploaded anywhere? expand_more

No. All minification happens locally in your browser.

Common Use Cases

  • Page Speed: Trim script size to improve Time to Interactive and Lighthouse scores.
  • Inline Scripts: Minify small inline JavaScript in HTML emails or landing pages.
  • Legacy Files: Reduce the size of older jQuery plugins before serving them.
  • Snippets: Compress analytics or tracking snippets before deploying.