Minify CSS, JS or HTML
Strip comments, indentation and dead whitespace out of stylesheets, scripts and pages, safely and without renaming a thing in your code.
Drop your files here
.css, .js, .mjs, .html, .htm, .txt · up to 20 MB
How to Minify
- 1
Drop your source files
Add up to twenty stylesheets, scripts or pages, each up to 20 MB. Every one is read and processed inside this browser tab.
- 2
Confirm the language
The file extension decides first, then the content itself. If neither settles it, choose CSS, JavaScript or HTML yourself before continuing.
- 3
Download the minified files
Each result comes back beside the original as a .min file, and a batch arrives as one ZIP.
Tokenised, so strings stay strings
Every file is scanned into real tokens before a single character is dropped. That is what keeps a comment marker inside a string from cutting the line short, a double slash inside a URL from swallowing a rule, and an angle-bracket comment opener inside a script from ending the block early. Naive whitespace stripping breaks on exactly these cases, and it breaks silently.
Line breaks that carry meaning are kept
In JavaScript a newline is sometimes a semicolon. A return followed by a line break returns undefined, while a return followed by a space returns the value, so replacing that break would change what the code does. Line breaks the language depends on stay put. In HTML, pre and textarea contents are copied verbatim, and conditional comments are kept: they are markup, not notes.
What it deliberately does not do
Variable names are not shortened and no source map is produced. Renaming locals means full scope analysis over a complete parser, and getting it slightly wrong breaks working code without warning. The savings here are smaller than a full build toolchain gives you, and everything they come from is reversible.
Your code is never uploaded
Reading, parsing and rewriting all happen inside this browser tab, with no server, no queue and no copy kept once you close it. That matters for source files, which routinely carry internal endpoints, comments about unreleased work and keys someone left in a config by accident.
Frequently asked questions
Is it safe to minify code I did not write?
The transformations here are all removals of things the language ignores: comments, indentation and redundant whitespace. Nothing is rewritten, reordered or renamed, so the output behaves the same as what you put in. Keep the original anyway, since a minified file is meant to be generated rather than edited.
Why are my variable names left as they are?
Shortening names is scope analysis layered on a complete parser for the language, and a mistake in it silently changes behaviour in someone's production code. That is not implemented, and no toggle pretends it is. The result is a safe shrink that is weaker than what a full bundler achieves, which is worth knowing before you compare byte counts.
Is this the same as obfuscation?
No. Minification removes bytes the parser does not need, and the logic stays readable once you reindent it. Obfuscation deliberately makes code hard to follow with renamed identifiers, string encoding and control-flow rewriting. Nothing here tries to hide anything.
Do I get a source map?
No source map is generated. Mapping minified positions back to original lines requires tracking every token through the rewrite, which is a build-tool job. For debugging, keep the unminified file and serve the minified one.
Can I minify several files at once?
Up to twenty per batch, and the language is worked out per file, so a stylesheet, a script and a page can go through together. A file with a syntax error is reported by name and skipped without cancelling the others.
What happens if a file has a syntax error?
You get the line and column instead of a result. An unclosed CSS block or a declaration missing its value stops that file on purpose: emitting a truncated stylesheet that looks fine until it reaches production is worse than an error message.
Why did my file barely get smaller?
It was probably minified already. When the output is nearly the size of the input there is nothing left to remove, and the tool says so plainly while still handing the file back rather than blocking you.
Are embedded styles and scripts inside HTML compressed too?
Yes. Style and script blocks in a page are minified with the same machinery as standalone files, and whitespace between tags collapses to a single space. A broken inline script does not take down the rest of the page; that block is left as it was.