JavaScript Minify
Minified JavaScript from your pasted code.
Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.
JavaScript Minify
How to use this tool
- Enter your values in the fields above.
- Press Generate to see the result.
- Use Load sample to try the worked example, Copy result to copy it, or Clear to start again.
Worked example
The code “var x = 1; // note” on one line and “var y = 2;” on the next minifies to var x=1;var y=2;.
What this tool does not do / Limits
This is a simple comment and whitespace minifier. It is not a full optimiser: it does not rename variables, remove dead code, or guarantee identical behaviour for tricky code, so test minified output before using it.
Frequently asked questions
Will minified code run the same?
For ordinary code it should, but always test it, because this simple tool does not understand every language edge case.
Does it shorten variable names?
No. It only removes comments and unnecessary whitespace; names stay exactly as written.
Related tools
JSON Studio
Format, validate, minify, query and compare JSON in your browser, with precise line-and-column errors.
LiveRegex Tester
Test patterns against sample text with match highlighting, capture groups and a safe one-second timeout.
LiveSecurity Header and DNS Checker
Check HSTS, CSP and other security headers, TLS details, and DNS/email authentication records (SPF, DKIM, DMARC).
Live