CSS Formatter

Paste messy or minified CSS below, then click Format to beautify it or Minify to compress it. Nested rules, media queries, and multi-value properties like box-shadow are all handled correctly.

More ways to experience Recasely:

Cf

CSS Formatter / Minifier

Cleaning up messy stylesheets by hand is slow and error-prone. This free CSS formatter and CSS beautifier turns compressed or poorly indented CSS into a clean, readable structure, or works as a CSS minifier for production to reduce file size. It correctly handles nested rules like @media queries, comma-separated selector lists, and multi-value properties — a layered box-shadow or transition value gets one line per layer so it's easy to scan and edit, while simple comma lists like font-family stay on one line. Everything runs in your browser; nothing you paste is ever sent to a server.

When should I minify vs. beautify my CSS?

Beautify (Format) while you're actively writing, debugging, or reviewing CSS — readable indentation and one declaration per line make it far easier to spot mistakes. Minify only for the version you actually ship to production: stripping whitespace and comments shrinks the file and speeds up page loads, but a minified file is nearly impossible to hand-edit, so keep a formatted source copy and minify as a build step, not as your working copy.

Does this handle nested rules like @media queries?

Yes. Rules inside an @media, @supports, or similar block are indented one level deeper than the block itself, and their own nested declarations indent one level deeper still, so the structure stays clear no matter how deeply your stylesheet nests conditions.

Why do some properties like box-shadow break onto multiple lines?

Properties like box-shadow, transition, and background often hold several layered values separated by commas — each layer is itself a small group of numbers and keywords. Putting each layer on its own line makes a stack of shadows or transitions much easier to scan and edit than one long run-on line, which is why this formatter breaks them out automatically. Simpler comma lists, like a font-family fallback stack, don't need that treatment and stay on a single line.

Is there a size limit on the CSS I can format?

Not from this tool specifically — since everything happens in your browser instead of on a server, your device's own memory is the real ceiling, not a number we've imposed. Very large stylesheets may take a moment longer to process, but there's no artificial cap on length.

Last reviewed: August 2026