Format CSS with a real parser, so a brace inside a string, a semicolon inside url() and a comma inside :is() all survive the trip intact.
Waiting for a stylesheet
Parsed rather than split on braces, so strings, comments and url() survive intact.
Formatted CSS appears here
One declaration per line, nested at-rules indented, and the spacing inside calc() left alone.
CSS Formatter runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
The obvious CSS formatter splits the source on braces and semicolons. It works until it meets ordinary CSS, and then it fails in at least five ways.
A string can contain a brace — content: "}" is valid and common in generated content. A comment can contain anything at all. url(data:image/svg+xml;base64,…) contains semicolons that end nothing. Modern selectors are full of commas that do not separate selectors: :is(.a, .b), :not(.x, .y), [href*="a,b"]. And @media, @supports, @layer and @container, along with CSS nesting, put whole rules inside other rules, so braces are not flat.
This reads the stylesheet character by character, tracking strings, comments and bracket depth, and builds a tree. The formatter prints that tree, which is why it survives all five.
Within a value, whitespace is tidied but never removed where it carries meaning. The spaces in calc(100% - 2rem) stay, because removing them makes the expression invalid. The space in grid-area: 1 / 2 stays. A space is added after each comma, so a font stack and an rgba() become readable — and never inside a string, so content: "a,b" is untouched.
Parse problems do not stop the output. A missing brace is worth knowing about, and the fastest way to see where it is is usually to look at the formatted result, so the tool shows both: the problems, with line numbers, above the formatted stylesheet.
No. The spaces around the operator in calc() are required by the syntax, and the formatter preserves them. It also preserves the space in values like grid-area: 1 / 2 and margin: 0 auto, where whitespace separates distinct values.
Yes. Nested rules, @layer, @container, @supports and functional pseudo-classes such as :is(), :where() and :has() are all parsed as structure rather than split on punctuation.
They are kept by default, on their own lines, with multi-line comments retaining their internal shape. You can drop them with a switch. A comment written inside a declaration value is removed, because there is nowhere sensible to put it.
No. It means the structure is readable. The parser does not know which properties exist or which values are legal for them, so a stylesheet full of invented property names will format perfectly and do nothing in a browser.
Yes. Formatting already-formatted output returns the same text, so it will not fight with another formatter or give a different answer on a second run.
Only if you ask it to, and never for custom properties. CSS property names are case-insensitive but custom properties are not — --Brand and --brand are two different properties — so those are always left exactly as written.