CSS, HTML & JS Minifier

Real production-grade minification — powered by csso, html-minifier-terser and Terser

Input

Minified output

Nothing you paste here is ever uploaded to a server of ours — minification runs entirely in your browser using open-source libraries loaded from a public CDN.

About this tool

Minification strips out whitespace, comments, and (for JavaScript) renames local variables to shorter names, without changing what the code actually does when it runs. Rather than a hand-rolled regex trick, this uses the same real minifier libraries production build tools rely on — csso for CSS, html-minifier-terser for HTML, and Terser for JavaScript — so the output matches what you'd get from a proper build pipeline.

Can minifying my code accidentally break it?

A correct minifier only removes things that don't affect execution — whitespace, comments, and safely-renameable local names — so well-formed code should behave identically after minifying. Code that relies on unusual quirks (like reading a function's source via toString()) is the rare exception worth testing after minification.

Why does JavaScript minification shrink files more aggressively than CSS or HTML?

Terser doesn't just remove whitespace — it can shorten local variable and function names, drop dead code branches, and fold constant expressions. CSS and HTML minifiers mostly just strip formatting and redundant syntax, since renaming class names or tag structure would risk breaking the page.

Should I keep the original, unminified file around?

Yes — always keep your readable source as the version you edit, and treat the minified output as a build artifact you regenerate for production. Debugging minified code directly is painful without a source map.