CSS Formatter

Beautify messy CSS so it's readable, or minify it to shrink the file.

How to use CSS Formatter

  1. Paste your CSS into the box.
  2. Choose Beautify to indent it, or Minify to compress it.
  3. Copy the result.

Frequently asked questions

Does Beautify indent nested rules, like inside an @media query, more deeply?

No — every declaration is flattened to the same 2-space indent regardless of nesting depth, so a rule nested inside @media won't appear more indented than a top-level rule.

Does Minify strip comments?

Yes — /* ... */ comments are removed entirely, along with whitespace around braces, colons, semicolons, and commas, and the trailing semicolon before a closing brace is dropped too.

Can I paste minified CSS in and get it back readable?

Yes — click Beautify on minified input and it inserts line breaks and indentation at each brace, semicolon, and comma just as it would for hand-written CSS.

Community

Loading...