About the CSS Formatter
Turn a one-line minified stylesheet back into readable code. Each rule and property gets its own line with consistent indentation, which makes debugging and editing much easier.
Minified CSS from a production site, a theme download or a browser’s network tab is a single unreadable line. When you need to find why a button looks wrong, learn how a design was built or edit a theme you did not write, the first step is making the stylesheet readable again. This formatter re-indents CSS so each selector, property and closing brace sits on its own line.
Choose an indent of 2 spaces, 4 spaces or a tab, and optionally a blank line between rules for extra breathing room. At-rules such as @media, @supports and @keyframes, and native CSS nesting, are indented correctly so the structure is clear. Formatting is handled by the open-source js-beautify library, which is widely used in code editors.
How to use the CSS Formatter
- 1Paste your CSS.
- 2Choose the indent (2 spaces, 4 spaces or tab).
- 3Click Format and copy the result.
Key features
- 2 spaces, 4 spaces or tab indentation.
- Optional blank line between rules.
- Handles @media, @supports, @keyframes and nesting.
- Powered by js-beautify.
- Copy the formatted CSS.
Practical uses
- Reading a minified stylesheet from a live website.
- Editing a purchased WordPress or Shopify theme.
- Cleaning up CSS before committing it.
- Learning CSS by studying how other sites are built.
- Comparing two stylesheets after formatting both the same way.
Example
The minified rule .btn{padding:8px 16px;border-radius:6px}.btn:hover{opacity:.9} becomes two clearly separated blocks, each property on its own line and indented beneath its selector.
Tips and common mistakes
- Use the browser’s developer tools alongside the formatted file to match rules to elements.
- Pick the same indent style your project uses to keep diffs clean.
- Run the CSS Minifier again before publishing if you edit the formatted copy.
- Format, edit, then minify again: keeping that loop prevents readable but heavy files reaching production.
Limitations
- Comments removed during minification cannot be recovered.
- Invalid CSS is formatted as-is and not fixed.
Privacy
Formatting runs locally; stylesheets are never uploaded.
Frequently asked questions
Does formatting change how my CSS works?
No. Only whitespace and line breaks are changed.
Does it support media queries and nesting?
Yes. @media, @supports, @keyframes and native CSS nesting are indented correctly.
Which engine is used?
The open-source js-beautify library.
Does it sort properties?
No. Properties stay in their original order, because order can matter when the same property appears twice.
Can it format SCSS or Less?
Simple SCSS and Less usually format well, but advanced syntax such as mixins may not be indented perfectly.
Is there a size limit?
No fixed limit. Large framework stylesheets of several hundred kilobytes format in a moment.