JavaScript Minifier
Strip comments and normalise whitespace from JavaScript in ASI-safe mode — strings and template literals are copied verbatim, newlines preserved.
How to use
- Paste your JavaScript.
- Read the minified output and the saved percentage.
- Copy the result for quick bundle trimming.
Example
Input: // init const url = "a b";
Output: const url = "a b"; (string spaces preserved)
How it works
Comments and unnecessary whitespace are removed from the JavaScript and statements are compacted. The code's behaviour is unchanged — only its size is reduced.
Limits & compatibility
- No renaming, dead-code elimination or mangling — use a build tool for that.
- Regex literals are treated as unknown tokens: patterns survive, but this is not a parser.
- Newlines are kept so automatic semicolon insertion never changes meaning.
Privacy
Your code never leaves the browser. There is no server call, no storage and no logging of content.
Related tools
Questions about JavaScript Minifier
Is my input private?
Yes. This tool runs entirely in your browser — your input never leaves your device, is never uploaded to a server and is never stored.
How accurate is the result, and what are the limits?
The tool page states its formula and limits openly. Check them before relying on a result, and verify anything consequential — financial, legal, medical or safety-critical — against an authoritative source.
What happens to files I open with this tool?
Files are processed locally in your browser and never uploaded; closing the tab discards them. Text tools never store what you paste — it lives only in the page while you use it.