CSS Formatter

Format and beautify CSS code with proper indentation.

Format CSS so it's easy to read: one declaration per line, consistent indentation and a blank line between rules. Paste minified or messy CSS, including media queries and nested at-rules, choose 2 spaces, 4 spaces or tabs, and copy or download the result. It uses js-beautify in your browser and changes only whitespace, so your styles behave exactly the same.

Common use cases

  • Read a minified stylesheet from a website or library
  • Tidy CSS pasted from a design tool or a forum
  • Make a stylesheet consistent before a code review

How to use

  1. Paste your CSS, or press Try an example.
  2. Choose the indent.
  3. Copy or download the formatted CSS.

FAQ

Does it work with SCSS or Less?

Simple SCSS and Less usually format fine, but nesting and mixins aren't fully understood. It's built for plain CSS.

How do I make CSS smaller?

Use the CSS minifier, which removes whitespace and comments and shortens values.