126+ free tools that run in your browser — no uploads, no sign-up

JS Minifier

Minify JavaScript to reduce file size for production.

JavaScript is usually the heaviest part of a web page, and unminified code makes it worse.

About JS Minifier

Compress JavaScript source code by removing whitespace, comments, and shortening variable names, producing a smaller file for faster page loads. This JS minifier is handy for quick, dependency-free minification of scripts outside a full bundler setup.

JavaScript is usually the heaviest part of a web page, and unminified code makes it worse. The JS minifier compresses your script by removing whitespace and comments, shortening local variable names and simplifying expressions, producing a much smaller file that downloads and parses faster. It's powered by a industry-standard compressor and runs entirely in your browser.

How to use JS Minifier

  1. Paste your JavaScript source into the input area.
  2. Run the minifier.
  3. Review the compressed output and the size reduction.
  4. Copy or download the minified script.

Key features

  • Whitespace and comment removal with variable-name mangling.
  • Dead-code and expression simplification.
  • Reports errors if the input isn't valid JavaScript.
  • Local processing, so proprietary code is never uploaded.

Common use cases

  • Shrinking a small script or widget snippet before embedding it on a page.
  • Preparing inline JavaScript for an email or landing page.
  • Checking how much a script would shrink before adding a build step.

Frequently asked questions

Related tools

More Developer tools