JavaScript Minifier

Minify and compress JavaScript online for free using Terser — real parsing keeps your code correct. Optional name mangling. Runs entirely in your browser.

100% private — runs entirely in your browser. Your files never leave your device.

100% private — runs in your browser

Uses Terser to compress and (optionally) mangle variable names — real parsing, so the output stays correct. Everything runs in your browser; your code is never uploaded. Large files may take a moment.

How to use the JavaScript Minifier

  1. Paste your JavaScript.
  2. Toggle name mangling on or off.
  3. Click Minify (real parsing via Terser).
  4. Copy or download the .min.js.

What you can use it for

  • Compress JavaScript for faster loading
  • Mangle names for smaller bundles
  • Minify safely without breaking code
  • See exact byte savings

More free tools

Wrangling code or data?

Format, encode, hash and minify with our free developer tools — 100% in your browser.

Browse all free developer tools →

Frequently asked questions

How does this minify JavaScript safely?

It uses Terser, a real JavaScript parser and compressor, so the output is functionally identical — not a fragile regex that can break code.

What does 'Mangle names' do?

It shortens local variable and function names (e.g. 'total' becomes 'a') for smaller output. Turn it off if you need readable names or rely on specific names.

Will minifying break my code?

Terser preserves behaviour. If your code has a syntax error, the tool reports it instead of producing broken output.

Is my code uploaded?

No — minification runs entirely in your browser; your code never leaves your device.