JavaScript Minifier
Minify JavaScript code online for free. Remove comments, whitespace, and optimize your JS files for faster page loading.
📥 Input
📤 Output
JavaScript Minifier
This free online JavaScript minifier reduces file size by removing comments, whitespace, and shortening boolean values. Improve your website performance by serving minified JS files. Supports syntax-safe minification that preserves string literals.
🔥 Popular Tools
ℹ️ About JavaScript Minifier
JS Minifier compresses a pasted script by stripping comments and collapsing whitespace, with optional passes that shorten true and false to !0 and !1 and remove console.log calls. String and template literals are held aside during the rewrite, so quoted text survives intact. It reports original size, minified size and the percentage saved, useful when you need to trim a standalone script before dropping it into a page without setting up a build step. Copy the result or download it as script.min.js; nothing leaves your browser.
💡 Use Cases
📋 How to use
Paste your JavaScript into the Input box, or click Load Sample to try the tool on example code.
Tick the options you want: Remove Comments, Remove Whitespace, Shorten Booleans (true becomes !0) and Remove console.log.
The minified result appears in the Output box as you type; click Minify to re-run it after changing an option.
Click Beautify first if the pasted code is on one line and you want to read it indented before minifying.
Check the stats bar for original size, minified size, percentage saved and bytes saved.
Click Copy to take the minified code, or Download to save it as script.min.js.
💎 Pro Tips
- Paste your content directly — the Js Minifier detects common input patterns and applies sensible defaults automatically.
- Use keyboard shortcuts (Ctrl/Cmd+A to select all, Ctrl/Cmd+C to copy) to speed up your workflow inside the Js Minifier.
- For very large inputs, break them into chunks — most browser tabs can handle megabytes of text, but parsing huge payloads may freeze the UI briefly.
- The Js Minifier does not log or store your input. If you need history, copy important outputs to a local file or note app.
- Combine the Js Minifier with other tools on this site (formatters, converters, encoders) to build complete data pipelines without leaving your browser.
❓ Frequently Asked Questions
Yes, fully free with no signup, no API key, no watermarks, and no usage limits.
No. The Js Minifier runs entirely client-side in your browser. Your input never touches our servers.
There is no hard limit, but expect slowdowns on inputs larger than a few megabytes, depending on your device's memory.
Yes. Outputs generated with the Js Minifier are yours to use freely in any personal or commercial project.
Most of the logic runs in client-side JavaScript, so after the initial load you can often keep working without a network connection.
None. Because the Js Minifier runs in your browser, you can process as many inputs as your hardware allows without API keys or throttling.