lobsite! Sign in Sign up

Free · runs in your browser · no sign-up

CSS Formatter

Paste minified or messy CSS and get one rule per block, one property per line, indented the way you like. Free, in your browser.

Format your CSS

CSS minifier →
Formatted

Next Minify it again for production: CSS Minifier → Publish your site ↓

How to use the CSS formatter

  1. Add your CSS

    Paste it, open a .css file, or start from the sample: a minified stylesheet.

  2. Pick the indentation

    Choose 2 spaces, 4 spaces or tabs. The formatted CSS appears as you type.

  3. Copy or download it

    Save it as styles.css.

What the CSS formatter changes

Every rule gets its own block, every declaration its own line, and rules inside @media and other at-rules are indented a level deeper. Selectors, values and comments are kept as they are, so the stylesheet means exactly the same thing.

When to format CSS

  • Reading a minified stylesheet from a theme, a framework or a site you're inspecting.
  • Tidying CSS before you edit it, so a change touches one line instead of one very long one.
  • Comparing two stylesheets: format both, then diff.

CSS formatter FAQ

Does it fix invalid CSS?

No. It indents what's there; a missing brace stays missing. Browsers skip declarations they can't read, so a stray character usually breaks one rule, not the stylesheet.

Does it sort properties?

No. Order can matter in CSS (a later declaration wins), so it's kept as written.

Can I minify it again afterwards?

Yes: the CSS Minifier turns it back into one compact line.

Is my CSS uploaded?

No. Formatting runs in your browser.

Publish your site with its stylesheet

Drop the folder, or run one command. Free, and live in seconds.

All formatters and minifiers →