Code minifier
Shrink CSS and JavaScript with a real parser, not a find-and-replace.
A parser, not a find-and-replace
This is the important thing about this tool, because the version it replaces got it badly wrong. The old minifier on this site was a set of regular expressions, and regular expressions cannot parse code.
It treated // inside a string as a comment, so const url = "https://example.com" became const url = "https: — with everything after it deleted. It rewrote the contents of CSS strings. It collapsed newlines inside <script>, putting whole script bodies behind a single line comment. And it reported a cheerful percentage saved over the wreckage.
The replacements parse properly: terser for JavaScript, csso for CSS, and the browser's own HTML parser for markup. None of them can make those mistakes, because none of them work on text.
What each one does
CSS — strips comments and whitespace, shortens values, merges identical rules and drops overridden declarations. Typically 20–35%.
JavaScript — renames local variables, removes dead code, folds constants. Typically 30–60%, and more on well-named code.
HTML — removes comments and collapses insignificant whitespace, while leaving <pre>, <textarea>, <script> and <style> untouched. Usually 5–15%.
Broken input is reported, not mangled
Because these are parsers, invalid code fails with a message and a position instead of producing something subtly wrong. That makes the tool a passable syntax check in its own right.
Is it worth doing?
Honestly, less than it once was: gzip and brotli recover much of the same saving, and any competent server already applies them. Minifying still helps because the two compound — but if your assets are not compressed in transit, fixing that matters far more.
Nothing is uploaded
Your source stays in the browser, which matters for anything unreleased.
Common questions
Will it break my code?
No. These are real parsers working on a syntax tree. The regex-based tool this replaces did break code, routinely.
Why did it reject my file?
A parser reports syntax errors rather than guessing. The message usually points straight at the problem.
How much smaller will it get?
Roughly 20–35% for CSS, 30–60% for JavaScript, 5–15% for HTML — before gzip.
Is minifying still worth it?
Somewhat. Compression recovers much of the same saving, though the two do compound.
Can it un-minify?
No. Variable names are gone for good — that is where most of the saving comes from.
Is my code uploaded?
No, it is processed in your browser.