CSS Formatter / Beautifier

Format messy or minified CSS. Optionally sort properties alphabetically (or by group) and normalize colors and units. Useful for cleaning up emitted CSS, comparing two stylesheets, or preparing snippets for code review.

How to use the CSS Formatter / Beautifier

Paste CSS. Format produces readable output with each declaration on its own line. Minify strips comments and whitespace. The optional sort-alphabetically pass reorders declarations within each rule — useful for diff-friendly stylesheets.

Formatting and tidying CSS

CSS arrives minified from a build, concatenated from several files, or hand-written with inconsistent spacing and property order, and in that state two stylesheets that are functionally identical produce a noisy diff that hides the real change. Declarations crammed onto one line are also hard to scan when you are hunting for the rule that sets a colour or a margin.

This formats CSS with one declaration per line and consistent indentation, can lowercase hex colours, and can optionally sort properties within each rule so two stylesheets diff cleanly. To go the other way and shrink CSS for production, use the CSS minifier; for the markup around your styles, the HTML formatter; and to put Tailwind utility classes into canonical order, the Tailwind class sorter.

Common use cases

  • Expand minified CSS — turn a one-line stylesheet into readable rules.
  • Diff two stylesheets — sort properties so the real change stands out.
  • Normalise colours — lowercase hex values consistently.
  • Clean an export — tidy CSS emitted by a tool for review.
  • Prepare a snippet — format a rule before sharing in a code review.

Frequently asked questions

Can it sort properties alphabetically?

Yes — an optional pass reorders declarations within each rule for diff-friendly output.

Does it minify as well?

No — this formats; the CSS minifier handles the shrink direction.

Will it change my colours or values?

Only if you ask — the lowercase-hex option normalises colour case; values are otherwise left as written.

How do I order Tailwind utility classes?

That is a different job — use the Tailwind class sorter.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: