Code Minifier
Compress HTML, CSS or JavaScript by removing whitespace and comments. The language is detected automatically. JavaScript uses Terser in its safest mode — no variable renaming, no logic changes. See the size reduction in bytes after minifying.
How to use
Paste your code
Drop HTML, CSS or JavaScript into the input field.
Click Minify
The minifier detects the language automatically and strips whitespace and comments.
Read the result
See the minified code and the size reduction in bytes.
Copy or download
Copy the minified code or save it as a file.
Features
HTML, CSS and JavaScript
One tool for all three — the language is detected automatically.
Safe JavaScript mode
Uses Terser with compression and mangling disabled — the safest possible mode.
Preserves pre and code blocks
HTML minifier leaves the contents of pre, textarea, script and style untouched.
Size comparison
See original and minified size side by side.
Error display
Shows clear errors if the code is malformed.
Common use cases
- Minify CSS before deploying a website
- Compress JavaScript for production
- Reduce HTML file size for faster page loads
- Check how much smaller minified code is