JavaScript Minifier
Minify JavaScript with Terser — the same engine bundlers use. Local names are shortened, whitespace removed and constants folded, all in your browser, so your source code never leaves your device.
81 → 0 bytes
How to use it
- 1Paste JavaScript
Paste your JS source into the input box.
- 2See the minified output
Terser compresses the code live and shows the size saved.
- 3Copy
Copy the minified JavaScript with one click.
Real minification with Terser
This isn’t just whitespace removal: Terser parses your code and rewrites it — renaming local variables, folding constant expressions and dropping dead code — to produce genuinely smaller output that runs identically.
Paste a snippet or a whole file. Syntax errors are reported so you can fix the source before shipping.
Frequently asked questions
Is my code uploaded anywhere?
No. Minification runs entirely in your browser with Terser compiled to run client-side; your source never leaves your device.
Does it change how my code behaves?
No. Terser preserves behaviour — it only makes the code smaller. Avoid relying on function or variable names being preserved.
Why do I get a syntax error?
Terser must parse valid JavaScript. The error points to where parsing failed so you can fix the source.
Related tools
HTML Minifier
Minify HTML by removing comments and collapsing whitespace, while keeping <pre>, <script> and <style> intact. Runs entirely in your browser — nothing is uploaded.
CSS Minifier
Minify CSS to shrink stylesheet size: remove whitespace, comments and redundant values. Runs entirely in your browser — nothing is uploaded.
JSON Formatter
Format, minify and validate JSON in your browser with precise error locations. Fast, private and free — your data never leaves your device.