CSS Formatter and Minifier

Paste a stylesheet, then choose Format to indent each rule or Minify to shrink it. The tool only changes spacing and removes ordinary comments, so the styles keep the same meaning. Nothing is sent to a server.

CSS Formatter and Minifier runs entirely in your browser: the text you paste is never sent to a server. It is free and needs no sign-up.

How to use it

  1. Paste your CSS In the CSS Formatter and Minifier, paste CSS into the input, up to 1,000,000 characters. The result below updates as you type.
  2. Choose format or minify Pick Format (multi-line) or Minify (one line). For Format, choose an indent of 2 spaces, 4 spaces or a tab, and a line width of No limit, 80 or 120 characters.
  3. Copy or download Press Copy to copy the result, or Download .css to save formatted.css, or minified.css after Minify. If a string or comment is not closed, your input stays as written and the line and column appear.

Questions

Will formatting change my CSS values or comments?

No. Formatting only changes spacing and line breaks. Strings, comments, values and selectors keep their characters, and the tool checks that nothing else changed. If the check fails, your original text is kept and a message explains why.

What does the minified CSS keep?

Minify is conservative. It removes comments, but keeps comments that start with /*! so license notices stay. It also removes extra spaces and the last semicolon in each block, and it does not rename or merge rules. Spaces around operators such as + and - are left alone, so calc() keeps working.

Why does the tool warn that brackets do not pair up?

The tool warns when brackets do not match. It still formats the text, but the layout may be wrong, so use the result only as a reference. Input longer than 1,000,000 characters is not processed at all and stays as written.