CSS Beautifier turns minified or messy CSS into clean, indented code with one rule and one declaration per line. Paste your CSS, choose the indent, click the button and copy the result. It is free and runs in your browser.
.container{width:100%;max-width:1200px;margin:0 auto}h1{font-size:2rem;color:#333}button:hover{background:#c8f135}.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
h1 {
font-size: 2rem;
color: #333;
}
button:hover {
background: #c8f135;
}Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.
A CSS beautifier, also called a CSS formatter, adds line breaks, indentation and consistent spacing to CSS. Minified code, which is written on one line to save space, becomes easy to read and edit.
The tool changes only whitespace: each selector gets its own line, each declaration goes on its own line, and a space is added after colons and commas. The values, selectors, comments and strings stay as you wrote them.
It is made for plain CSS and does not check your code for errors. Use it before you edit a minified file, review a stylesheet or compare two versions.
Each rule and declaration goes on its own line. These examples use a 2 space indent.
| Before | After |
|---|---|
a{color:red} | a {
color: red;
} |
h1,h2{margin:0} | h1,
h2 {
margin: 0;
} |
@media (max-width:600px){.nav{display:none}} | @media (max-width: 600px) {
.nav {
display: none;
}
} |
a{color:red!important} | a {
color: red !important;
} |
Reading minified CSS, cleaning up a stylesheet before you edit it, making code reviews easier and keeping the same style across a project.
The tool does not validate CSS or support SCSS and Less syntax such as // comments. Keep a copy of your original code, or use Undo right after formatting.
To make CSS smaller before you publish it, use a CSS minifier. To format other code, try the HTML, JavaScript, JSON or XML beautifiers.
A CSS beautifier takes minified or messy CSS and adds line breaks, indentation and consistent spacing, so each rule and declaration is easy to read and edit. It is also called a CSS formatter.
Paste your CSS into the box, choose the indent size and click Beautify CSS. The formatted code replaces the text in the box. Click Copy to use it, or Undo to go back.
No. The tool only changes whitespace, such as line breaks, indentation and the space after a colon or comma. It also adds a missing semicolon after the last declaration in a rule. Values, selectors, comments and strings are kept as they are.
Beautifying adds spaces and line breaks to make CSS readable. Minifying removes them to make the file smaller. Use a beautifier when you want to read or edit code, and a minifier before you publish it.
You can choose 2 spaces, 4 spaces or a tab. Two spaces is a common choice for CSS, but use whatever your project or style guide requires.
Yes. Rules inside @media and @supports blocks are indented, comments are kept, and values such as url(data:image/png;base64,...) and quoted strings are not broken, even when they contain semicolons or braces.
It is made for plain CSS. Simple nested rules may be indented correctly, but preprocessor syntax such as // comments, mixins and maps is not supported and may be formatted wrongly.
No. It is a formatter, not a validator. If your CSS has a missing brace or a typo, the tool formats what it can, but it does not report errors. Use a CSS validator or your editor to find them.
Yes. It is free, needs no account and runs in your browser, so your CSS is not uploaded to a server.
Last updated: 26 October 2026