JavaScript Minifier
Minify JavaScript by removing whitespace and comments and shortening local variable names.
Input
Paste JavaScript above, or upload a .js file.
Output
How to use JavaScript Minifier
- Paste your JavaScript or upload a file.
- Click Minify JavaScript.
- Copy the result or download it, and keep your original as the version you edit.
Frequently asked questions
Does minified code behave the same?
Yes. Comments and spacing are removed, and names used only inside a function are shortened. Names visible to other scripts are not renamed.
What if my code has a syntax error?
The tool stops and tells you the line, rather than producing broken output.
Which JavaScript versions are supported?
Modern JavaScript, including classes, arrow functions, async/await and modules.
Is my text uploaded to a server?
No. This tool runs entirely in your browser, so what you paste never leaves your device.