Dev TooloraLocal dev tools

> Formatters

CSS Formatter & Minifier

Format or minify CSS locally. Nested at-rules and CSS nesting are indented, and values are never rewritten.

Runs locallyWorks offline
Back to results
Input

Source data

Mode
Indentation
Output

Result

Your result will appear here.

Tool guide

About this tool.

Formatting puts each selector block on its own line and each declaration on its own indented line. Nested at-rules such as @media and CSS nesting rules are indented one level deeper.

The tool uses its own small tokenizer, so strings, comments, url() values and escapes are copied exactly as written.

Minify removes comments and layout whitespace. Comments that start with /*! are kept for licenses. Spaces that change meaning, such as in a b, 0 auto or and (, are kept.

Paste CSS or choose a sample.

Choose Format to indent the stylesheet, or Minify to remove comments and layout whitespace.

Pick 2 spaces, 4 spaces or tabs for Format mode.

Copy the result or save it as a CSS file.

  • a{color:red;margin:0 auto} → a { color: red; margin: 0 auto; } with one declaration per line.
  • @media (min-width:600px){a{b:c}} → the rule for a is indented inside the media block.
  • a{content:"}{;"} → the string is kept intact.
  • /* x */ a { color: #FFFFFF; } → a{color:#FFFFFF} in Minify mode.

  • Processing is local; nothing is uploaded.
  • Limits: 5,000,000 input characters and 100 nesting levels.
  • Minify never transforms values: colors, units, zeros and shorthands stay as written.

FAQ

Questions about CSS Formatter & Minifier

Does minify rewrite my values?

No. Colors, units, zeros and shorthands stay exactly as written, so #FFFFFF and 0px are not shortened.

Does it validate CSS?

No. It does not check property names or values. Only unbalanced braces, unterminated strings and unterminated comments are errors.

Does it support CSS nesting?

Yes. Rules nested with & or plain selectors inside a rule are indented like nested at-rules.

Are license comments kept?

Yes, comments that start with /*! are kept. All other comments are removed in Minify mode and kept in Format mode.

Where is the error in my CSS?

The error names the line and column of the unclosed block, unexpected brace or unterminated string or comment.

Continue with

HTML Formatter & MinifierFormat or minify HTML locally. Block elements are indented, and pre, textarea, script and style content is kept byte for byte.CSS Box Shadow GeneratorBuild one to five editable shadow layers with a real card preview, opacity, inset mode and exact CSS export.