Menu
PDF Tools
Image Tools
Converters & Utilities
Seller & Print Tools
Accounting & Business
Calculators
Text & Writing Tools
Developer & Web Tools
Creator & Social Tools
Browser Utilities & Games
Document & Design Makers
Text & Developer Tools
Exam & Form Tools

CSS Beautifier

This tool formats CSS. It puts each property on its own line, indents the rules, splits selectors onto lines and puts a space after each colon.

How to use CSS Beautifier online

  1. Paste the CSS. Minified or messy.
  2. Choose the indent. 2 or 4 spaces.
  3. Read the result. The formatted CSS appears at once.
  4. Copy it. Copy or save the result.

Why use this free CSS Beautifier

  • One property per line
  • Selectors split by line
  • Media queries indented
  • Urls and strings kept
  • Indent option
  • Share by link

From one line to a layout

Minified stylesheets are one long line. The beautifier reads them and writes each rule with its properties on separate lines, an indent for the contents of a rule, and a blank-free layout that is easy to scan. It also works on CSS that was written in an untidy way, with mixed spacing and layout.

How it formats

Each selector in a list goes on its own line. The opening brace follows the last selector, each property ends with a semicolon and sits on a line, and the closing brace is on its own line. Rules inside @media blocks are indented one more level. A semicolon is added after the last property of each rule.

A worked example

The one-line sheet with three rules, one inside a media query, becomes 13 lines:\n.a { color: red; margin: 0 auto; } .b, .c>.d { background: url(x.png) no-repeat; } @media (min-width: 600px) { .a { color: blue; } }\nThe media query has a space after the colon in its condition, and the url is left as it was.

Care with strings and urls

Strings and url() addresses are never changed, so a colon or a semicolon inside them does not cause a wrong break. Comments are removed during formatting, because the tool reads the sheet in its compact form. If you need to keep comments, use your editor’s own formatting instead.

Related tools

The CSS minifier does the opposite. The indent can be 2 or 4 spaces, and the space after the colon can be turned off. The tool does not sort the properties or check that they are valid, so a typo in a property name stays as it is.

Using the tool

The result shows under the boxes and refreshes as you edit. Find and replace is built into the editor with Ctrl+F and Ctrl+H.

CSS Beautifier: frequently asked questions

How do I format minified CSS?
Paste it and the layout is rebuilt at once.
What happens to comments in the CSS?
They are removed while the code is read.
Are urls safe?
Yes. They are kept exactly.
Does it check that properties are valid?
No. It only changes the layout.
Can I change the indent?
Yes, 2 or 4 spaces.
Can anyone see the text I put into the CSS Beautifier?
Your text stays on this device when you use the CSS Beautifier. The editor may keep the last text locally and offers to bring it back; you can dismiss it.
Can I save what the CSS Beautifier gives me?
Copy the CSS Beautifier result, or save it as a text file from the result box.

Related searches for CSS Beautifier

  • CSS Beautifier online
  • free CSS Beautifier
  • CSS Beautifier online free
  • CSS Beautifier for mobile
  • CSS Beautifier without sign up
  • CSS Beautifier – Text & Writing Tools

CSS Beautifier is a free online tool on MAITBOX, in the Text & Writing Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.

More tools in Text & Writing Tools →

Search tools