CSS / JS / HTML Minifier
Minify CSS, JavaScript, and HTML in your browser.
Paste CSS, JS, or HTML to minify it
Choose CSS, JS, or HTML, paste your code on the left, then click Minify. You will see the original vs minified size and how much you saved — all in your browser.
Runs entirely in your browserMinify CSS, JavaScript, and HTML, locally
This minifier strips comments and collapses redundant whitespace from CSS, JavaScript, and HTML to shrink file size. It favours correctness over maximal compression: rather than a full uglifier, it makes conservative, regex-based passes that are safe to run on real code — CSS drops comments and tightens punctuation, JS removes comments and squeezes blank lines outside strings, and HTML strips comments and inter-tag whitespace while leaving pre, textarea, script, and style content untouched. Sizes are measured in real UTF-8 bytes, and everything runs in your browser tab so your code is never uploaded.
Common questions
What does this minifier actually do?
It removes comments and collapses unnecessary whitespace for the language you pick. CSS also tightens spacing around braces, colons, and semicolons; HTML collapses whitespace between tags. It does not rename variables, reorder rules, or restructure code.
Why is it 'conservative' rather than a full uglifier?
A true minifier parses the language into an AST to rename symbols and rewrite code safely. This tool uses fast regex passes instead, so it never risks breaking your code — the trade-off is that it saves less than tools like Terser or cssnano. It is a light minify, not a full compression.
Is the output safe to ship to production?
The CSS and HTML passes are safe for typical, well-formed input. The JS pass is a light minify: it strips comments and collapses blank lines and indentation while trying to avoid touching string and regex contents, but because it is not a full parser you should test the result before shipping. For guaranteed-safe JS minification, run a proper build-step minifier.
Does my code get uploaded anywhere?
No. Minification runs entirely in your browser using plain JavaScript. Nothing is sent to a server, so it works offline and keeps your code private.
How are the sizes measured?
Both sizes are the real UTF-8 byte length via new TextEncoder().encode(text).length, not character count. The percent saved is the byte reduction from original to minified, so multi-byte characters are counted accurately.