Skip to content
Tools

CSS Formatter & Minifier

Beautify CSS into a readable layout or minify it to one line.

Local
Result

What this tool does

This tool formats CSS into a readable, indented layout, or minifies it down to a single compact line. It understands rules, nested at-rules such as media and supports queries, comments and strings.

Format or minify

Format puts each declaration on its own line, indents nested blocks, and spaces out the colons, so a dense stylesheet becomes easy to read. Minify strips comments and whitespace for the smallest output, which is useful for checking size or pasting into a constrained field.

Why testers reach for it

Reading selectors and rules is easier when the CSS is formatted, which helps when you are writing or debugging style-dependent locators and visual checks. Minifying lets you compare the essential content of two stylesheets without whitespace noise.

Common use cases

  • Making a minified stylesheet readable to find a selector or rule.
  • Tidying hand-written CSS before committing it.
  • Comparing two stylesheets by their minified form.

Frequently asked questions

Does it keep media queries?
Yes. Nested at-rules such as media and supports queries are preserved and indented.
Is my CSS uploaded?
No. It is formatted entirely in your browser and never leaves the page.

Learning resources

Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.

Feedback welcome

Found a bug in this tool, or want it to do something it does not? Tell us and we will take a look.