convertCASEpro

MODE

CSS Formatter

Paste CSS and get tidy, consistently indented code, or a compact minified version.

INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0

How the CSS Formatter works

Beautify mode formats the stylesheet using Prettier, a widely used code formatter. Rules are broken onto separate lines, declarations are indented, spacing around colons and braces is normalized and long selector lists are wrapped sensibly.

Minify mode removes comments and unnecessary whitespace and trims the final semicolon in each block. Minifying here is a basic transformation, so for large production builds use a dedicated build tool that can also merge rules.

When it is useful

  • •Reading CSS copied from a minified production file.
  • •Standardizing the indentation of styles from different authors.
  • •Shrinking a small snippet before pasting it into an inline style tag.
  • •Spotting syntax errors, since the formatter reports where parsing fails.

Frequently Asked Questions

Does it change what my CSS does?

Beautifying only changes whitespace and line breaks. Minifying removes comments and whitespace but keeps every declaration.

What if my CSS is invalid?

The formatter shows the first parse error with its position instead of producing partial output.

Can it format SCSS or Sass?

Use the SCSS Formatter for SCSS syntax such as nesting and variables.

Related tools

[ Browse all tools ]