CSS Formatter

  • CharsCharacter Count: 0
  • WordsWord Count: 0
  • SentencesSentence Count: 0
  • LinesLine Count: 0

CSS formatter: beautify and minify stylesheets online

Use this for styles pasted from DevTools, legacy CMS exports, or teammate handoffs—not as a replacement for PostCSS, Sass, or your production bundler.

How to use this converter

  1. Paste CSS—from a single rule to an entire stylesheet.
  2. Choose indent size and click Format to expand nested rules.
  3. Click Minify to compress for inline experiments or size checks.
  4. Copy the output into your editor; run your usual linter before committing.

Selectors, nesting, and at-rules

Formatted CSS groups declarations under each selector with consistent indentation. `@media`, `@supports`, and `@keyframes` blocks nest visually so you can spot unclosed braces quickly. Modern nested syntax from preprocessors may paste as flat CSS—formatting still helps even if nesting was already compiled.

Custom properties (`--token`) and `calc()` expressions are preserved verbatim; the formatter does not evaluate math or resolve variables.

What minify removes—and what it keeps

Minify strips most comments and collapses whitespace between tokens. License comments required for third-party libraries may be removed—keep originals in source control. Minified CSS is harder to debug in DevTools; beautify again before editing if you inherited a one-line file from a CDN.

Typical workflow with HTML and SCSS

Extract a `

Before and after examples

OriginalConvertedNotes
.card{padding:1rem}.card h2{margin:0}Multi-line .card rulesMinified input
@media (min-width:48rem){.nav{display:flex}}Indented @media blockResponsive rule

Frequently asked questions

Does CSS Formatter validate properties?

No. Unknown or vendor-prefixed properties are left as written. Use stylelint or your browser for validation.

Can it format CSS inside HTML?

Paste only the CSS portion. Extract `

Will minify change specificity?

No. Only whitespace and comments change; selector order and declarations stay the same.