JavaScript Minifier
Minify and mangle JavaScript with Terser for smaller bundles. Supports modern ES syntax.
About the JavaScript Minifier
The JavaScript Minifier uses Terser, the minifier behind most JavaScript bundlers, to remove whitespace and shorten local variable names (mangling) for smaller files.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the JavaScript Minifier
- Paste JavaScript or open a file.
- Choose whether to mangle names and apply compression optimisations.
- Copy or download the minified code.
Frequently asked questions
What does mangling do?
It renames local variables and function parameters to short names. Global names and object properties are left alone, so behaviour does not change.
Does it support modern syntax?
Yes, ES2015+ features such as modules, classes, async functions and optional chaining are supported.
Related tools
JSON Minifier
Minify JSON by removing all unnecessary whitespace. Shows the size saved.
HTML Minifier
Minify HTML by removing comments and collapsing whitespace while preserving pre, textarea, script and style blocks.
CSS Minifier
Minify CSS by stripping comments and whitespace to reduce stylesheet size.
XML Minifier
Minify XML by removing comments and whitespace between tags.
SQL Minifier
Compress SQL queries onto a single line, removing comments and redundant whitespace.
JSON Formatter
Format and beautify JSON with configurable indentation and optional key sorting. Errors are reported with exact line and column.