JavaScript Minifier
Shrink JavaScript for production with Terser — the same minifier used by webpack, Vite and Next.js. See exactly how many bytes you save, before and after gzip.
- PrivateYour data never leaves this device
- No uploadsProcessed in your browser, not on a server
- 100% freeNo signup, no watermark, no trial
- UnlimitedUse it as often as you like, no daily caps
JavaScript input
Minified
How to use the JS Minifier
- Paste your JavaScript, open a .js file or load the sample.
- Choose options: mangle names, compress, keep /*! license */ comments, ES module.
- Check the size, saving and gzip numbers — or the error's line and column if the code doesn't parse.
- Copy the minified code or download it as a .min.js file.
Latest guides
All →
SEO & MarketingHow to make a Wi-Fi QR code so guests join without typing
Make a WiFi QR code so guests join your network by pointing a phone camera at it. The format, hidden networks, special characters, safety…
12 Nov 20266 min read
PDF ToolsHow to watermark NID and certificate copies before sharing
Watermark NID copy and certificate PDFs with who it is for, the purpose and the date, so a copy given for one job is hard to reuse for…
12 Nov 20265 min read
PDF ToolsHow to number the pages of a thesis or project report PDF
Thesis page numbering made simple: the usual rules for front pages and chapters, and how to number a finished PDF from Chapter 1 for free…
12 Nov 20265 min readFrequently asked questions
What does a JavaScript minifier do?
It removes whitespace and comments, shortens local variable names (mangling) and rewrites code into shorter equivalent forms, such as removing unreachable branches. The behavior stays the same but the file downloads and parses faster.
Is minified JavaScript safe to use?
Yes, Terser preserves the meaning of valid code. Code that relies on function or class names at runtime (for example fn.name) can be affected by mangling, so turn mangling off if you depend on names.
What does the ES module option do?
It parses the input as a module, so import and export statements are allowed and strict mode is assumed. It also lets Terser rename top-level names, because module scope isn't global.
Why keep /*! comments?
By convention, comments starting with /*! (and those with @license or @preserve) hold license notices that many open-source licenses require you to keep. The option keeps those and removes everything else.
Should I still enable gzip or Brotli on my server?
Yes. Minification and compression work together: minifying removes redundancy that compression can't, and gzip or Brotli then shrinks the result further. The gzip estimate shows the size actually sent over the network.
Is my code uploaded?
No. Terser runs inside your browser, so your source code never leaves your device.