CSS Minifier
Strip whitespace & shorten CSS
Two modes behind one button. Minify removes block comments, collapses every run of whitespace to a single space, drops the spaces around the punctuation that needs none, deletes the final semicolon before each closing brace and trims both ends. It is a text transformation rather than a parser, which is fast and predictable but also its limitation: selectors, values, at-rules and media queries pass through untouched, while anything inside quotes or url() is not treated as special. Beautify runs the other way, inserting a brace and a two-space indent, placing each declaration on its own line and separating blocks with a blank line. A three-tile report gives the encoded byte count before and after plus the percentage saved, measured with TextEncoder rather than a character count.
Minify stylesheets by removing comments, whitespace and last semicolons, with a before/after size report. Safe, local and instant — no build pipeline required.
Private CSS Minifier In Your Browser
CSS Minifier is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.
How to use CSS Minifier
Paste CSS into the input area, or leave the sample button stylesheet that is already loaded.
Choose Minify to compress or Beautify to reformat, then press Minify CSS or Beautify CSS to run the conversion.
Read the result panel, which prints the output and, when minifying, adds Before, After and Saved tiles.
Press the copy button in the result panel's header to take the transformed text, or edit the input and run it again.
- Minification strips comments, collapses whitespace, removes spaces around the brace, colon, semicolon, comma and combinator characters, and drops each block's last semicolon.
- The size report is measured in encoded bytes rather than characters, so multi-byte content is counted correctly.
- Beautify lives in the same panel and converts a compressed file back into indented, one-declaration-per-line form.
- Nothing is renamed, reordered or merged, so a rule that worked before still works after the transformation.
- A developer compressing a one-off inline stylesheet before pasting it into a template, without standing up a build.
- Someone handed a compressed production stylesheet uses Beautify to make it readable enough to locate the rule they need.
- A student comparing a readable block with its compressed form to see precisely which characters were removed and why.