Code Minifier
Minify HTML, CSS, and JavaScript to reduce file size
How to Use
- Select the language of your code (HTML, CSS, or JavaScript) from the dropdown.
- Paste your source code into the Input box.
- Click Minify to strip comments, collapse whitespace, and shorten the code.
- Review the Minified output and the size savings stats, then click Copy to use it.
Frequently Asked Questions
What languages can I minify with this tool?
The tool minifies HTML, CSS, and JavaScript. Pick the language from the dropdown, paste your code, and click Minify. Each language uses regex-based rules tuned for that syntax.
How much file size can I save by minifying code?
Savings depend on the original code: well-indented files with lots of whitespace and comments can shrink by 40–60%, while already-compact code may shrink by only 5–10%. The tool shows original size, minified size, and percentage saved.
Does minification break my JavaScript code?
Minification preserves token boundaries so the runtime behavior is unchanged. However, it removes comments and whitespace, and may strip trailing semicolons in some cases. Always keep your original source and use source maps for production debugging.
Is my code uploaded to a server?
No. All minification happens entirely in your browser with JavaScript. Your code never leaves your device, so it is safe to use on proprietary or sensitive content.