CSS Formatter

Pretty print CSS with one declaration per line, or minify it into a single compact line.

Your CSS

Rules: — · Declarations: —
Comments, strings and at-rules are preserved, and everything runs locally in your browser.

How to use the CSS Formatter

  1. Paste the stylesheet you want to clean up.
  2. Pick an indent width and click Format, or click Minify to compact it.
  3. Copy the result with the Copy button.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online css formatter.

It rewrites a stylesheet so every declaration sits on its own indented line, which makes long rules far easier to read and review.
At-rules such as media, supports and keyframes are detected automatically, so their inner rules are indented one level deeper.
Yes. The Minify button strips comments and redundant whitespace while keeping quoted strings and url values untouched.
No. Only whitespace between rules and declarations changes. Selectors, values, comments and at-rules stay exactly as written.
Comments are kept and placed on their own line, or left inline when they sit inside a declaration.
Yes. Content inside parentheses such as url data URIs is copied without splitting it at semicolons or commas.
No. Everything runs in your browser, so your stylesheet never leaves your device.
Yes, the CSS formatter is completely free and unlimited, with no account or sign-up needed.

Last updated: October 10, 2026