Make your CSS code readable, structured, and easy to maintain
Proper indentation makes CSS easier to understand and maintain
Spot syntax errors and structural issues at a glance
All processing happens locally in your browser
Choose between 1‑5 spaces to match your style guide
Transform messy, minified, or poorly indented CSS into clean, readable code.
Our CSS formatter processes your code with these steps:
The code is parsed into a structured tree (rules, selectors, declarations).
Rules are indented based on nesting, using the number of spaces you selected.
The result is a beautifully formatted CSS block, ready for review or editing.
@media (max-width:350px){.bd-examples{margin-left:-.50rem;margin-right:-.50rem}.bd-examples>[class^="col-"]{padding-right:.50rem;padding-left:.50rem}}@media (max-width:350px) {
.bd-examples {
margin-left: -.50rem;
margin-right: -.50rem
}
.bd-examples>[class^="col-"] {
padding-right: .50rem;
padding-left: .50rem
}
}Paste this compressed rule and choose 2 spaces:
@media (min-width:40em){.card{display:flex;gap:1rem}.card h2{margin:0}}The formatter expands the media query, puts each declaration on its own line, and indents the nested rule. It uses the js-beautify CSS formatter. It does not compile SCSS or LESS, and it does not check whether gap is supported by a particular browser.
A missing closing brace usually remains a missing closing brace. Read the formatted result before replacing the source file.