Follow Us

JavaScript Minifier

Shrink your JavaScript with Terser — the same minifier used by modern build tools. Supports ES6+, shortens names, removes dead code and shows the size you saved.

Minified JavaScript

Runs in your browser — your code is never uploaded. Tip: drop a file on the input box, or press Ctrl + Enter.

How to Minify JavaScript

Get a smaller, faster .js file in three steps.

1

Paste or Upload JS

Paste your JavaScript, upload a .js file, or drop it on the left box.

2

Choose Options

Keep the defaults for the smallest file, or turn on Remove console.log for production.

3

Copy or Download

Copy the result or download script.min.js. The size saved is shown under the output.

Engine

Terser 5

Supports

ES6+ & modules

Shows

Size saved in %

Privacy

Runs in your browser

Works on

Phone & computer

Price

100% free

JS Minifier Options Explained

What each option does and when to use it.

OptionWhat it doesUse it when
CompressRemoves unused code, joins statements and simplifies expressionsAlmost always
Shorten variable namesRenames local variables like fullName to nAlmost always (global names are not touched)
Remove console.logDeletes all console.* callsFor production code
ES moduleTreats the code as a module (import/export, strict mode)Your file uses import or export
Keep licence commentsKeeps comments starting with /*! or containing @licenseOpen-source code that requires credit

What Can You Use It For?

Popular ways people use JS Minifier.

Faster Page Load

Smaller JS downloads and parses faster, improving speed scores.

Plugins & Widgets

Minify a script before sharing it or adding it to a CMS.

Bookmarklets

Squeeze code into one short line for a bookmarklet.

No Build Tool Needed

Minify a single file without installing Node.js or webpack.

Tips for the Best Result

  • Keep the original file — minified code is very hard to edit.
  • If you see an error, the line and column are shown so you can fix it in the original code.
  • Use Remove console.log only for production; you may need logs while testing.
  • Need to read minified code? Use the JavaScript Beautifier. Want to protect it? Try the JavaScript Obfuscator.

Frequently Asked Questions

Quick answers about JS Minifier.

A tool that makes JavaScript files smaller by removing spaces, comments and line breaks and shortening variable names, without changing what the code does.

Terser 5 — the minifier used by webpack, Vite and most modern build tools. It runs fully in your browser.

Yes. Modern JavaScript (ES2015 to ES2020+) is fully supported. Tick ES module if your file uses import or export.

No, as long as the original code is valid. Global names are not renamed, so other scripts can still call your functions.

No. Minifying makes code smaller; it can still be read with a beautifier. Obfuscating makes code hard to understand on purpose.

Terser can only minify valid JavaScript. The message shows the line and column of the problem — often a missing bracket or comma.

No. Everything runs in your web browser, so your code and data never leave your device.

Yes — 100% free, with no sign-up and no limits.

Related Free Tools

Ready to Use JS Minifier?

Scroll up and get your result in seconds. 100% free, no sign-up needed.

Start Now

Ad Blocker Detected

Toolszu provides free access to over 1,000 tools. We rely on minimal ads to maintain our servers and keep improving the site for everyone.

Please pause or disable your ad blocker to continue using Toolszu.