⌘

CSS Beautifier

Format css content for easier reading.

0Words
0Characters
0Sentences
0mReading time
Choose a file or fill the fields, then click Run tool.

About CSS Beautifier

Minified stylesheets from a CDN, a theme or a browser's DevTools are hard to read when you want to find one rule or learn how a component is styled. Expanding them puts each declaration on its own line, which makes it easier to scan, copy or edit a specific property.

How it works

Four text replacements do the work. Each opening brace becomes a space, the brace and a new line. Each semicolon is followed by a new line and two spaces of indent. Each closing brace moves onto its own line, followed by a line break. Lines that contain only spaces are then cleaned up. No space is added after colons, and nesting is not tracked. Rules inside @media are indented at the same level as the media query itself. Semicolons inside strings or data URIs are split too. The output can be saved as pretty.css.

How to use CSS Beautifier

  1. Enter the text or data in the format shown in the text box above (Paste CSS).
  2. Select “Run tool” and check the result before copying or downloading it.

Worked example

Input: .a{color:red;margin:0}. Output, four lines: .a {, then color:red; indented two spaces, then margin:0 indented two spaces, then the closing brace at the margin. The colon spacing stays exactly as written, since only line breaks and indentation are added.

Tips for a better result

  • Inside @media blocks, nested rules are not indented deeper. Read the closing braces carefully to see where a media query ends.
  • Data URIs or font strings that contain semicolons will be broken across lines. Keep those declarations aside, or restore them by hand afterward.
  • Run the CSS through the Code Minifier later if you need it compact again after editing.

Frequently asked questions

Does it sort or validate properties?

No. Properties stay in their original order, and invalid CSS is formatted without warnings. Use a linter such as Stylelint if you need validation or property ordering.

Why is there no space after the colons?

The beautifier only inserts line breaks and indentation around braces and semicolons. It does not rewrite declarations, so color:red stays color:red.

Does it handle SCSS or Less?

Simple nested rules will get line breaks, but nesting depth is not reflected in the indentation, and features like // comments are not recognized. Results are best with plain CSS.

What to check

A formatted or parsed result is not proof that code is secure, correct or production-ready. Never paste production secrets.

Read the Privacy Policy for information about local processing, connected services and advertising.