Skip to content

JavaScript minifier

Reduce the size of your JavaScript files by removing whitespace and comments.

Savings: {{ savingsPercentage }}% ({{ formatBytes(originalSize - minifiedSize) }} saved)
Source code (raw JS) {{ formatBytes(originalSize) }}
Minified code {{ formatBytes(minifiedSize) }}
{{ error }}

What is JavaScript minification?

JavaScript minification is the process of removing all unnecessary characters from a program's source code without changing its functionality. For JavaScript (`.js` files), this involves removing:

  • Whitespace, tabs and line breaks.
  • Comments left by developers (// or /* */).
  • Smart shortening of local variable names (for example, turning let myCounter = 0; into let a=0;).

Why is this crucial for SEO and performance?

JavaScript is one of the "heaviest" files for a browser to load and run (render-blocking resources). By reducing the size of your JS file by 30% to 60% with our tool, you speed up your page's download time.

Google directly factors Core Web Vitals (site speed) into organic search rankings. Tools like Google PageSpeed Insights or Lighthouse will penalize you if you serve unminified JavaScript code in production.

Terser: the engine behind our tool

To ensure your code always works perfectly after compression, we use Terser, the current industry standard for JavaScript optimization (the same engine used natively by Webpack and ViteJS). Your modern code (ES6+, arrow functions, async/await) is fully supported and compressed on the client side, without ever passing through a server.

More optimization tools:

How it works

How to use the JavaScript minifier

Reduce the size of your JavaScript files by removing whitespace and comments.

  1. Paste your content

    Paste the JavaScript code.

  2. Minify

    Spaces, line breaks and comments are removed.

  3. Copy the result

    Copy or download the result in one click.

FreeNo subscription, no hidden limits.
No sign-upOpen the page and use the tool. That’s it.
InstantResults in seconds, on mobile too.
PrivateEverything runs in your browser.

About the JavaScript minifier

A lighter script downloads faster and improves page performance. Always keep the unminified source version.

javascript minifier js minifier minify javascript online compress js reduce javascript size js minify javascript compressor
FAQ

Frequently asked questions about the JavaScript minifier

Does minification change how the code works?

No. It only removes what is not needed for execution.

What savings can I expect?

Often 20 to 50% less weight, and more with gzip or brotli compression.

Can I get back to the original code?

Not entirely, so keep your source file.

Is the code sent anywhere?

No. The minification is local.

Esc
↑ ↓ navigateEnter open