CSS beautifier
Paste minified CSS and get indented, readable code back. The reverse of compressing: nothing is added or removed, only the layout is restored.
When you need a beautifier
Minified CSS is one long line. That is fine for a browser and terrible for a person. A beautifier — also called an unminifier or formatter — puts the structure back: one declaration per line, a tab per nesting level, a blank line between blocks.
Three situations come up again and again:
- You inherited a site and the only stylesheet left is the minified one. Formatting it makes it editable again.
- You want to understand how someone solved something. Copy the rule out of your browser's inspector, paste it here and read it properly.
- A build step went wrong and you need to see what actually came out, instead of squinting at one 40.000-character line.
What a beautifier cannot do
It restores layout, not information. Comments that the minifier removed are gone for good, and so are the original property order choices if a build tool reordered them. Class names that were mangled by a CSS-modules build stay mangled — no formatter can guess what .a3Xk2 used to be called. Keep your source files in version control; a beautifier is a rescue tool, not a backup.
How this one formats
Tabs for indentation, one declaration per line, a space after each colon, and the selector on the same line as its opening brace. Combinators keep their spaces (.a > .b), commas in selector lists get a space after them, and !important keeps a space in front of it. Values themselves are never rewritten, so #fff stays #fff — it does not expand shorthand back out, because it cannot know what you originally wrote.
Does beautifying change how my page renders?
No. Whitespace between declarations has no meaning in CSS, so adding it back cannot change the result. The only exception would be whitespace inside strings, which is left untouched either way.
Can it format CSS that has errors in it?
Mostly. Unclosed braces and stray characters are passed through rather than thrown away, so you can usually spot the mistake in the formatted output. It is not a validator though — for that, use the W3C CSS validator.
Does it work on SCSS or Less?
Partly. Nested blocks and declarations format fine, but preprocessor-only syntax such as mixins, @extend and variables with $ is treated as unknown content and passed through as-is. For SCSS, your preprocessor's own formatter will do a better job.
Other tools on this site
Read more
- What is CSS minification? – What a minifier removes and what it saves
- CSS optimization for speed – Beyond minification: critical CSS and Core Web Vitals
- What breaks a CSS minifier? – Live test of the constructs minifiers get wrong
- Minifying CSS in WordPress – Which plugin does what, and when it breaks
- Frequently asked questions – Answers to the questions we get most
- Useful links – Reference material on CSS and speed
- About this site – Who makes this and how to reach us