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
- Paste your CSS, or press Try an example.
- Choose the indent.
- 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.
Related tools
- CSS MinifierMinify CSS code by removing whitespace and comments.
- HTML FormatterBeautify HTML code with proper indentation and formatting.
- JS FormatterFormat and beautify JavaScript code with proper indentation.
- JSON Diff ToolCompare two JSON documents and highlight differences.
- JSON MinifierMinify JSON by removing whitespace and formatting.
- YAML ValidatorValidate YAML syntax and structure for configuration files.