🔍

JavaScript Minifier

🔒 In your browser

Minify JavaScript with Terser to shrink files and speed up sites.

How it works

Minify JavaScript — removing whitespace, comments and shortening local names — to reduce file size and speed up your site. Powered by Terser, running in your browser.

Try an example

Minified JS

🔒 Generated entirely in your browser — nothing is uploaded.

🔒 Runs in your browser: tags, sitemaps and minification are generated locally from what you type — nothing is uploaded, no signup, no limits.

About the JavaScript Minifier

This free JavaScript minifier shrinks your JS by removing whitespace and comments and shortening local variable names, reducing file size so your site loads and runs faster. It's powered by Terser — the industry-standard minifier — running entirely in your browser.

Your code is never uploaded.

How to use it

  • Paste your JavaScript.
  • The minified output and size saved appear instantly.
  • Copy it into your production bundle.

Minifying vs. obfuscating

Minification makes code smaller while keeping it functionally identical — it removes whitespace and comments and shortens local variable names. Obfuscation deliberately makes code hard to read and is a different goal. Terser minifies; it doesn't obfuscate. As always, minify as a build step, keep the readable source, and test the minified bundle before shipping.

Frequently asked questions

What does a JavaScript minifier do?

It removes everything the browser doesn't need — whitespace, comments — and shortens local variable names, producing much smaller code that behaves identically.

Is minified JavaScript the same as obfuscated?

No. Minification reduces size while keeping the code functionally identical; obfuscation deliberately makes code hard to read. Terser minifies, it doesn't obfuscate.

Will minifying break my code?

Terser is safe for standard JavaScript. As always, test your minified bundle, and keep the readable source for development.

Is my code uploaded?

No. Minification runs entirely in your browser with Terser.

Will minifying break my JavaScript?

Terser is safe for standard JavaScript and is what many build tools use under the hood. Test your minified bundle as a habit, and keep the original source for development.

Related searches

javascript minifierjs minifierminify javascriptminify js onlinejs compressorterser online

Learn more

Related SEO tools

🔗 Embed this tool on your website — free

Copy this and paste it into your page's HTML. The tool runs in the visitor's browser, just like here. Change height to fit, or add the optional auto-resize snippet below. Add ?theme=dark to the URL for dark mode.

<iframe src="https://toolhq.dev/embed/js-minifier/" title="JavaScript Minifier — ToolsHub" width="100%" height="520" style="border:1px solid #e5e7eb;border-radius:12px;max-width:680px" loading="lazy"></iframe>
Optional: auto-resize the iframe height

Add this once on the same page so the iframe grows to fit the tool:

<script>
addEventListener("message", function (e) {
  if (e.data && e.data.type === "toolshub:resize") {
    document.querySelectorAll('iframe[src*="/embed/"]').forEach(function (f) {
      if (f.contentWindow === e.source) f.style.height = e.data.height + "px";
    });
  }
});
</script>