Code Minifier
Strip whitespace and comments from CSS, JS and HTML.
Code Minifier removes comments, redundant whitespace and unnecessary characters from CSS, JavaScript and HTML, and reports the size saved before and after gzip. It is a conservative minifier that does not rename variables, so the output stays debuggable and safe. Minification runs in your browser, so unreleased code stays local.
Loading Code Minifier…
Runs entirely on your device. No file or text you enter here is uploaded. How to verify it.
How to use Code Minifier
- Paste the code and pick the language.
- Minify and compare the sizes.
- Copy the compact output.
Questions about Code Minifier
Does it rename variables like a build tool?
No. Mangling names is where minifiers break code, and it needs full scope analysis to be safe. This tool removes comments and whitespace only, which is where most of the gain is for CSS and HTML anyway.
Why does it also show a gzip size?
Because that is the number that matters over the wire. Minification typically saves 20-40% raw but much less after compression, since gzip already handles repeated whitespace well. Seeing both keeps expectations honest.
Should I minify by hand for production?
Not usually — your build tool should do it as part of the pipeline. This is for one-off files, snippets, and situations where there is no build step at all.
Is this a replacement for Terser or esbuild?
No. Those do scope analysis, dead-code removal and name mangling, and will always produce smaller output. This is for a single file where there is no build step, and it errs towards leaving your code working.
Will it break custom properties or media queries in my CSS?
No. Comments and redundant whitespace go; selectors, at-rules and property values are left exactly as written, including whitespace inside a value where that whitespace carries meaning.
Is Code Minifier really free, with no limits?
Yes. There is no account, no daily cap, no file-size tier and no watermark, because there is no server cost to recover. The site is funded by clearly disclosed partner recommendations on the Partners page, never by metering the tools.
Are my files or text uploaded when I use Code Minifier?
No. Everything is processed by JavaScript running in your browser, on your device. You can verify it: open your browser's developer tools, switch to the Network tab, and use the tool. You will see no request carrying your data — because there is nowhere for it to go.