Skip to content
XUtilHub

CSS Formatter & Beautifier – Format CSS, SCSS & Less

Beautify minified or messy CSS, SCSS and Less with one rule per line and consistent indentation. Powered by Prettier.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

About the CSS Formatter

Make compressed or messy stylesheets readable again: one declaration per line, consistent spacing and indentation, for CSS, SCSS and Less.

Key features

  • CSS, SCSS and Less
  • One declaration per line
  • Consistent spacing and indentation
  • Handles media queries, custom properties and nesting
  • Upload a .css file or paste code
  • Private: runs in your browser

Clean up any stylesheet

Minified CSS from a website or framework, or styles written in a hurry, are hard to read and maintain. Format them with consistent indentation and one declaration per line, using Prettier.

Before and after

.btn{display:inline-flex;padding:.5rem 1rem;border-radius:8px}.btn:hover{opacity:.9}

becomes

.btn {
  display: inline-flex;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}
.btn:hover {
  opacity: 0.9;
}

Formatting conventions

RuleExample
One declaration per linecolor: red;
Space after the colonmargin: 0;
Leading zero on decimals0.5rem
Hex colors in lowercase#FFF → #fff

CSS minifier, HTML formatter, and JavaScript formatter.

How to use the CSS Formatter

  1. Paste your code into the input box, upload a file, or click Sample to try it out.
  2. Choose the options you want, such as indentation, line width or dialect.
  3. The result appears instantly in the output panel. Syntax errors are shown with their line and column.
  4. Click Copy to copy the result, or Download to save it as a file.

Frequently asked questions

How do I unminify CSS?

Paste the minified CSS and the formatter puts each rule and declaration on its own line with consistent indentation. Comments that were removed during minification can't be restored.

Does it support SCSS and Less?

Yes. Choose SCSS or Less in the Syntax option to format variables, mixins and nested rules.

Will formatting change how my styles work?

No. Only whitespace and layout change. Selectors, values and their order stay the same.

How do I make CSS smaller instead?

Use the CSS Minifier, which removes whitespace and comments and merges rules to reduce file size.

Is my code uploaded anywhere?

No. Every developer tool runs entirely in your browser, so source code, configuration files and passwords never leave your device.

Which formatter do you use?

HTML, CSS and JavaScript are formatted with Prettier, the most widely used code formatter, so the output matches what most projects use. SQL uses sql-formatter, and minification uses Terser and CSSO.

Is there a size limit?

There's no fixed limit. Very large files (several megabytes) can take a few seconds, depending on your device.

Last updated:

Related Dev tools