JavaScript Minifier

Parse, compress and mangle JavaScript safely with Terser, configurable compatibility targets, production cleanup and source-map support.

Parser basedPrivate in browserSize analysis

JavaScript input

0 characters

Minified JavaScript

Generated output is not executed by this page
Your minified JavaScript will appear here.
0 BOriginal
0 BMinified
0 BSaved
0%Reduction
🧠

Real parser and compressor

Terser understands strings, templates, regular expressions, classes, modules and modern syntax. It is substantially safer than removing whitespace and comments with regular expressions.

🗺️

Source maps

A source map connects minified output to original source locations for debugging. Deploy the map only according to your security and observability policy.

🧪

Test production output

Minification can expose assumptions about globals, function names, evaluation order or side effects. Run your application tests against the generated artifact.

Minify JavaScript safely for production

Compression rewrites expressions while mangling shortens local names. Start with conservative settings, enable module and top-level optimization only when the input’s execution model is known, and keep license comments required by your dependencies.

Can minification change program behavior?

Well-written code normally remains equivalent, but unsafe assumptions, reliance on function or class names, dynamic evaluation, side-effectful console arguments and incorrect module settings can cause differences. Always test.

Does ES5 output transpile modern syntax?

No. Terser’s output target controls which transformations and syntax forms it may emit; it is not a full transpiler or polyfill system. Use Babel, SWC or your build tool when older browsers must run modern source.

Should I remove console calls?

Only intentionally. Removing a call also removes evaluation of its arguments, which can change behavior if those expressions have side effects. Prefer a logging abstraction or build-time policy.

Are source maps private?

They can reveal original source structure and content. Public maps improve browser debugging but may expose implementation details. Decide deliberately how maps are stored and served.