What minification does
Minification removes everything a browser does not need in order to run your code: comments, indentation, line breaks and redundant whitespace. The result is functionally identical but smaller, which means less to download and faster page rendering.
Typical savings are 20 to 30 percent for CSS and HTML. That may sound modest, but it applies to every page load, and combined with gzip compression at the server the effect is meaningful — particularly on mobile connections where latency dominates.
Why it matters beyond file size
CSS is render-blocking: a browser will not paint the page until it has downloaded and parsed your stylesheet. Shrinking that file directly reduces the time before a visitor sees anything. Since page speed affects both search ranking and bounce rate, this is one of the cheaper optimisations available.
The JavaScript caveat, stated plainly
This tool's JavaScript mode is deliberately conservative. It strips comments and blank lines but does not rename variables, remove dead code, or restructure anything.
That limitation is intentional. Aggressive JavaScript minification requires parsing the code into a syntax tree to understand scope and semantics. Doing it with pattern matching is unsafe — a regular expression cannot reliably distinguish a comment from a similar-looking sequence inside a string or a regular expression literal, and getting it wrong silently breaks your code.
For production JavaScript, use a proper tool such as Terser or esbuild, which parse properly and typically achieve 50 to 60 percent reduction. Treat this mode as a quick tidy-up rather than a build step.
What to watch for in HTML
Whitespace between inline elements is significant in HTML — removing the space between two spans genuinely joins the words. This minifier collapses whitespace between tags, which is safe in the overwhelming majority of cases but can occasionally alter spacing in text-heavy inline markup. Check the result if your page relies on inline layout.
Content inside pre and textarea elements preserves whitespace by definition, so avoid minifying HTML containing those.
Practical workflow
Keep your readable source and minify only what you deploy. Never edit a minified file directly; regenerate it from source instead. Name output files with a .min extension so it is obvious at a glance which is which, and if you are working on a larger project, generate source maps so browser developer tools can still show you the original code.
Runs in your browser
Minification happens locally, so proprietary code is not uploaded anywhere.
Frequently Asked Questions
How much smaller will my file be?
Typically 20 to 30 percent for CSS and HTML before gzip. Proper JavaScript minifiers achieve considerably more, around 50 to 60 percent.
Why is the JavaScript mode limited?
Safe JavaScript minification requires parsing the code properly. Pattern-based approaches can break code by misreading comment-like sequences inside strings. Use Terser or esbuild for production builds.
Does minification change how my code behaves?
It should not. CSS and HTML minification here is conservative, though whitespace between inline HTML elements can occasionally matter for layout.
Should I minify if my server already uses gzip?
Yes. The two are complementary — minification removes redundancy that gzip cannot, and the combination is smaller than either alone.
Is my code uploaded?
No. Everything is processed in your browser, so proprietary code stays on your machine.