Skip to content

CSS Formatter

Make minified or messy CSS readable again.

Indent

Everything runs in your browser. Nothing is uploaded.

More Developer Tools

All tools

How to use the CSS formatter

Three steps, all in your browser.

  1. 1

    Paste your input

    Type or paste your code or data. Press Sample to try an example.

  2. 2

    Pick the style

    Choose indentation or options. The result updates as you type.

  3. 3

    Copy the result

    Copy the output in one click. Nothing is saved or sent anywhere.

CSS Formatter: what to know

The CSS formatter uses Prettier to rewrite a stylesheet with one selector and one declaration per line, consistent indentation and spacing around colons and braces. It's the fastest way to read minified CSS from a website, a CDN or a third-party widget.

Only whitespace changes. Selectors, properties, values and the order of rules stay exactly as they were, which matters because the cascade depends on order: a later rule with the same specificity wins. Comments are kept.

Modern CSS formats fine, including custom properties (--brand: #334155), native nesting, @layer, @container and @media range syntax. Switch the language to SCSS or Less to format preprocessor stylesheets with Prettier's matching parser.

Popular uses

  • Reading minified CSS to find which rule styles an element
  • Tidying CSS copied from browser developer tools
  • Formatting snippets for documentation or a pull request
  • Cleaning up an old stylesheet before refactoring it

Tips for the best result

  • Formatting won't tell you which rules are unused; the Coverage panel in Chrome DevTools does.
  • If formatting fails, look for an unclosed brace or a missing semicolon just before the reported line.
  • Pair it with the CSS minifier: format to edit, minify to ship.

Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.

Frequently asked questions

No. The formatter changes only whitespace and line breaks. Selectors, declarations and their order are kept, so the cascade works exactly as before.

Yes. Choose SCSS or Less as the language and Prettier uses the matching parser. Modern plain CSS, including custom properties, nesting, @layer and @container, formats fine too.

No. Every tool runs in your browser, so your code, tokens, keys and files are processed on your device and are not sent to our server or stored. Reloading or closing the page clears them.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

Yes. The tools work in any modern browser on phones, tablets and computers, though large files and long code are easier to handle on a computer.