Notification
Go to Home All Tools Compare Glossary Blog Contact

JavaScript Minifier

Minify JavaScript online by removing comments and whitespace and shortening syntax, cutting file size without breaking your code.

Best on Desktop Client-Side (Private)
JS Minifier
Input
Ready
Drop JS file to import Processed 100% locally in your browser
Status: Ready
Local Browser (Zero Server Log)
Education

JavaScript Minification, Parsing & Safe Compression

01

What This Minifier Does

The engine parses your source into an AST with Terser, then emits compact JavaScript. Strip comments and whitespace in basic mode; advanced compression can fold constants and drop proven-unreachable code. It does not bundle npm packages, resolve imports, transpile TypeScript/JSX, or execute your script.

02

Parser Diagnostics Are Not Runtime Validation

A successful minify means Terser could parse and print the program. That is not the same as running the file in Node.js or V8. Code can minify cleanly and still throw at runtime, and some syntax (JSX, TypeScript) is rejected because it is not plain JavaScript.

03

Basic vs Advanced Compression

Basic compression keeps statement structure and only compacts formatting. Advanced compression is opt-in: Terser may rewrite equivalent expressions, remove dead branches it can prove unused, and drop debugger/console calls if you enable those checkboxes. Console removal can change behavior if you rely on console side effects.

04

Mangling Is Local by Default

Local mangling renames function-scoped bindings only. Top-level and exported names are left intact so pasted snippets and modules keep their public API. Global/toplevel mangling is not offered because it is easy to break scripts that other files depend on.

05

100% Browser-Local Processing

Parsing and minification run in your browser. Source is never eval’d. Companion tools include the <a href="/json-formatter" class="text-brandBlue-400 hover:underline font-semibold">JSON Formatter</a>, <a href="/css-minifier" class="text-brandBlue-400 hover:underline font-semibold">CSS Formatter &amp; Minifier</a>, <a href="/html-formatter" class="text-brandBlue-400 hover:underline font-semibold">HTML Formatter</a>, and <a href="/sql-formatter" class="text-brandBlue-400 hover:underline font-semibold">SQL Formatter</a>.

Good to know

Questions, answered

Quick answers about how this tool works.

No. It never uses eval, never injects your code into a preview runtime, and never runs the program. Terser only parses and reprints the AST.

No. Success means the parser accepted the source. It does not prove the script will run in a given browser, Node version, or module environment.

Yes. Set Comments to “Preserve license comments” to keep /*! … */ banners and comments marked @license or @preserve. “Strip comments” removes all of them.

Local mangling is usually safe for self-contained functions. It can still break code that uses eval, with, or string-based property access of local names. Leave mangling Off if you are unsure.

What do you need to work out next?

Search 244+ free tools by name, or pick a category below. Every one runs instantly in your browser — no signup, nothing to install.

More Developer Tools