How to use
- Choose the language: CSS, JS or HTML.
- Paste or type your code into the input box.
- Click Minify to strip comments and collapse whitespace.
- Check the size savings, then copy the minified output.
Frequently asked questions
Which languages can I minify?
CSS, JavaScript and HTML. For CSS it removes /* */ comments, for JS it removes // line and /* */ block comments, and for HTML it removes <!-- --> comments, then each collapses redundant whitespace to shrink the code.
Is my code uploaded anywhere?
No. Minifying happens entirely in your browser and your code is never uploaded. It runs 100% locally, so nothing you paste ever leaves your device.
How thorough is the minifier?
It is a lightweight, scanner-based minifier that removes comments and collapses insignificant whitespace. It does not fully parse or rewrite your code, so it favours leaving your code intact over the most aggressive size reductions.
Will it break my JavaScript?
For most code it is safe: the scanner leaves the contents of '…', "…" and `…` strings, regex literals and template literals untouched, and it keeps newlines so Automatic Semicolon Insertion is not broken. Since it does not run a full parser, always test the output before shipping.
Is CSS with calc(), url() and media queries handled correctly?
Yes. Quoted strings and url(...) values are copied verbatim, and it never trims around + - * / so calc() stays intact. It is deliberately conservative around colons and combinators to avoid corrupting valid CSS.
How much smaller will my code get?
It depends on how many comments and how much whitespace your code has. After you click Minify, the tool shows the original versus minified size in KB along with the percentage saved, so you can see the exact result.
About this tool
Free online CSS, JavaScript and HTML minifier. Remove comments and extra whitespace, see before/after size and savings, then copy — 100% in your browser, no uploads.