JavaScript Minifier
Compress JavaScript with real minification, not just whitespace removal.
Processed locally in your browser. Nothing you enter is uploaded or stored.
- Real minification via Terser: variable renaming and dead-code elimination, not just whitespace stripping.
- The same engine used by webpack, Rollup and Vite for production builds.
- Runs in your browser; code isn't uploaded.
Why this is private
- Processed locally in your browser. Nothing you enter is uploaded or stored.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Minifies JavaScript using Terser — the same production-grade minifier used by major bundlers — which renames local variables, drops dead code and strips whitespace/comments, not just whitespace removal.
How to use it
- 1Paste JavaScript code.
- 2The minified output updates automatically.
- 3Copy it or download as .js.
Tips
- This is real minification (renaming, dead-code removal), not just whitespace stripping — the output can look substantially different from the input while behaving identically.
Frequently asked questions
What people use it for
Shrink a standalone script before deploying itCompress a hand-written script that isn't going through a bundler.
Compress a code snippet for a size-limited contextFit a script into a bookmarklet, a URL, or a platform with a character limit.
See how much smaller minification makes your codeCheck the real savings before deciding whether to add a build step.
Related guides
- How to read JSON with a tree viewerA tree viewer turns a wall of brackets into a structure you can expand, search and copy paths from. Here's how to use one effectively.
- JSON parse errors explained: 'Unexpected token', 'Expected comma or brace', and the restWhat each common JSON error message actually means, the usual cause, and how to find the spot fast using line and column.
- How to format JSON (and actually understand the errors)JSON looks like a JavaScript object but follows stricter rules. Here's what those rules are and how to read the errors when they're broken.
Related tools
All developer toolsReady to use JavaScript Minifier?
JavaScript Minifier