What minifying does
Source code is written for people: indentation, comments, long names. None of it means anything to a browser. Minifying strips the whitespace and comments — and for JavaScript, shortens local variable names — so the file downloads faster. The behaviour stays exactly the same.
What each language gets
- CSS: comments and whitespace removed, the last semicolon in each block dropped,
0pxshortened to0 - HTML: comments removed and whitespace between tags collapsed, leaving
<pre>,<textarea>, scripts and styles untouched - JavaScript: run through Terser, which compresses and shortens names properly
- JSON: every space removed, or re-indented at two spaces
How to use it
- Pick the language and whether you want it minified or tidied.
- Paste the code. The before-and-after sizes appear with the result.
- Copy or download. For JavaScript, the Terser library is fetched the first time you use it.
When it is worth it
- CSS and JS usually shrink by 25–60%, and much more again once the server compresses them with gzip or brotli.
- Minify as part of a build, not by hand, on anything you work on regularly — keep the readable source and ship the small one.
- Tidying a minified file is useful for reading someone else's code, but it cannot bring back the original names or comments.
A caution on HTML
Whitespace between inline elements is meaningful — removing it can push two words together. The minifier here collapses space between tags, which is safe for block layout and can occasionally change spacing around <span> and <a>. Check the result before shipping a page.
Frequently asked questions
Does minifying change what my code does?
It should not. Whitespace, comments and local variable names carry no meaning. The one thing to check is HTML, where space between inline elements is visible on the page.
Can I get my original code back?
Not exactly. Tidying restores the formatting, but comments and the original variable names are gone for good. Always keep the unminified source.
Is my code uploaded anywhere?
No. CSS, HTML and JSON are handled by the page itself, and JavaScript is processed by a library downloaded into your browser. The code never leaves your machine.