CSS Formatter
Beautify CSS with one declaration per line and consistent indentation. At-rules such as @media and nested rules are indented, and strings and url() values are left alone.
Use the tool
Why this tool exists
Minified stylesheets from a build, a plugin or a copied snippet are hard to read and impossible to review. Before you can find which rule sets a colour or why a media query misbehaves, you need the file laid out properly.
This formatter puts selectors on their own lines, writes one declaration per line, and indents the contents of @media, @supports and similar blocks, including nested rules. Strings, url() values such as data URIs, and comments are protected, so content like "a;b{" does not confuse it. It does not reorder properties or fix mistakes, so a missing semicolon stays missing. Formatting is done in your browser, and your stylesheet is not uploaded.
How to use it
- Paste your CSS into the input box.
- Choose the indent: 2, 4 or 8 spaces, or a tab.
- Read the formatted stylesheet in the output.
- Copy it into your editor.
Frequently asked questions
Does it change my rules?
No. It changes layout only: line breaks, indentation and spacing around punctuation. Selectors, properties and values are the same, and property order is not changed.
Are data URIs and strings safe?
Yes. Content inside quotes and url() is not touched, so base64 data URIs and strings with semicolons or braces are kept as they are.
Does it support nested CSS and @media?
Yes. @media and other at-rules are indented, and nested rules inside them or inside other rules get deeper indentation.
Can it fix invalid CSS?
No. It does not validate. A missing semicolon or brace will still be missing in the output, though the layout may help you spot it.