Sometimes you just need to shrink a CSS, HTML, or JavaScript snippet without setting up a full build pipeline. This tool strips comments and collapses whitespace safely — no variable renaming, no restructuring — so the output stays predictable, entirely in your browser.
How to use the code minifier tool
- 1
Pick a language
Choose CSS, HTML, or JavaScript.
- 2
Paste your code
Add the code you want to shrink.
- 3
Copy or download
Grab the minified version, and see exactly how many bytes were saved.
Common use cases
Shrink a stylesheet before deploying
Strip comments and whitespace from CSS to reduce its file size.
Compress an inline script
Minify a small JavaScript snippet before embedding it in an HTML page.
Clean up exported HTML
Remove comments and excess whitespace from HTML pulled out of another tool.
Frequently asked questions
It's intentionally conservative — it strips comments and collapses whitespace, but doesn't rename variables, remove unused code, or restructure logic the way a full build-tool minifier (like Terser) does. That makes it safe to use on any snippet without a build step.