JavaScript Minifier
Free JS minifier: compress JavaScript by removing comments, spaces and line breaks, and see the size saving. Variable names stay readable for debugging.
- 100% free
- No sign-up
- Runs in your browser
Paste, upload or load JS code to minify...
Only comments and spaces that cannot change the result are removed; text inside strings, templates and regular expressions is kept exactly. Licence comments (/*! … */) are kept. Variable names are not shortened, so the code stays readable in error messages.
Webmaster Tools
About the JavaScript Minifier
The JavaScript Minifier makes scripts smaller by removing comments, line breaks and spaces. The code runs the same, but downloads faster.
It does not rename your variables, so error messages stay readable when you debug. Licence comments marked /*! … */ are kept. Paste code or upload a .js file. Everything runs in your browser, so your text or code never leaves your device.
How to use this tool
- 1Paste your JavaScript, or upload a .js file.
- 2Copy or download the minified code.
- 3Test your page after replacing the file.
Best-practice tips
- Keep your original file for editing.
- For bigger savings, build tools can also shorten variable names; this minifier keeps them for safety.
- The fastest script is the one you do not load: remove scripts you no longer need.
Faster JavaScript
- Load scripts with defer or async so they do not block the page from showing.
- Remove unused plugins and tracking tags.
- Minify and compress what is left.
See which scripts slow your page with the Website Speed Test.
Answers
JavaScript Minifier FAQs
A tool that removes comments, spaces and line breaks from JavaScript so files download faster.
It should not, but test the page afterwards and keep the original.
No. It is minified in your browser.
Yes, with no sign-up.
Related tools
Continue with these related webmaster tools.
Meta Tag Generator
Free meta tag generator: create your title tag, meta description, robots and canonical tags with a live Google search preview and character counter.
View Page Source
Free page source viewer: see the HTML source code of any website with line numbers, a search filter and tag counts. Works on any device, including phones.
XML Sitemap Generator
Free XML sitemap generator: crawl your website (up to 5,000 pages) or paste a URL list and download a valid sitemap.xml. Leaves out redirects, errors and noindex pages.