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.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use CSS Beautifier online
- Paste the CSS. Minified or messy.
- Choose the indent. 2 or 4 spaces.
- Read the result. The formatted CSS appears at once.
- 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?
What happens to comments in the CSS?
Are urls safe?
Does it check that properties are valid?
Can I change the indent?
Can anyone see the text I put into the CSS Beautifier?
Can I save what the CSS Beautifier gives me?
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.