Skip to content
Allin

CSS minifier

Shrink CSS by removing comments and unnecessary whitespace.

Open CSS minifier and you get an answer straight away, with no account to create. Its place is under JSON, XML & formats; JavaScript Minifier / Beautifier and CSS Beautifier answer the questions closest to this one.

How to use it

  1. Open the tool — no signup or install needed.
  2. Enter your input or adjust the available options.
  3. Get your result instantly, then copy or download it.

Frequently asked questions

What does CSS minifier do?

Shrink CSS by removing comments and unnecessary whitespace.

When would I actually use this?

Making a machine-generated blob readable, finding the character where a parse fails, and shrinking a file before it ships.

What is the most common mistake?

Assuming valid means correct. A document can parse cleanly and still have the wrong shape for whatever will read it — validation checks the syntax, not the schema.

How is CSS minifier different from JavaScript Minifier / Beautifier?

They sit next to each other but answer different questions: JavaScript Minifier / Beautifier is the one to open when you need it to minify or beautify JavaScript in your browser, with a tokenizer that respects strings, regex and comments. Pick whichever matches what you're starting from — both are free.

Is there a tool for the next step?

CSS Beautifier is the closest one after this: Reformat minified or messy CSS into clean, properly indented rules — or minify it back.

Where do the figures come from?

Parsing and serialisation follow each format's specification. Key order and whitespace are not semantically meaningful in JSON or YAML, so a reformatted document is equivalent even when the bytes differ.

Further reading

All guides
GuideBeautify or Minify: What Each Is For, and What It Does to the WeightFour real stylesheets run through the minifier, measured raw and after gzip. Stripping every space saved 48, 103, 104 and 147 compressed bytes; stripping comments saved 57, 1 358, 2 420 and 1 042. Plus the five inputs this minifier breaks.GuideTransposing a Table Whose Rows Should Have Been ColumnsWhat happens to the header row, what happens to rows of unequal length, what happens to types — and the one thing transposing is regularly mistaken for and cannot do.GuideWhat a Minifier Can Remove, and What It Must NotMinification has to preserve meaning, and the interesting part is the whitespace that carries meaning: the descendant combinator, the spaces inside calc(), the gap between two inline elements. Measured here on real files, including how much brotli was going to save you anyway.How-toBuilding a Markdown Table From Scratch, Without Counting Dashes by HandThe smallest thing that is still a table is two lines: a header row and a delimiter row. Here is why the second one is mandatory in GitHub Flavored Markdown, where pipe tables do not exist at all, and what a generator does that hand-typing cannot.GuidePasting a Table Into a Pull Request: What Breaks, and the Two Characters That Break ItA Markdown table has exactly two forbidden characters in a cell: the pipe and the line break. Here is what each one does, how a converter handles them, why the escape has to be applied in the right order, and why padding never matters.ExplainerCSV to JSON: The Five Cases That Break Every ConverterQuoted delimiters, embedded newlines, ambiguous types, duplicate headers and encoding. Each one was run through the converter and the exact output is printed here — including the two cases it does not rescue.