CSS formatter

Beautify or minify stylesheets.

Mode
Indent

0 lines · 0 characters

0 lines · 0 characters

Results update as you type.

Runs in your browser. Nothing uploaded.

How to format CSS

  1. Paste your CSS into CSS, for example a minified stylesheet copied from a live site.
  2. Keep Format selected and pick 2 or 4 spaces. Choose Minify instead to make it as small as possible.
  3. Copy the result or download it as a .css file.

What formatting does

  • Puts each selector on its own line, followed by one property per line.
  • Adds a space after each colon and a blank line between rules.
  • Indents rules inside @media and other at-rules one level deeper.
  • Leaves property order, values and comments as they are. It doesn’t add a missing final semicolon.

Formatting vs. minifying

Formatting is for people: readable CSS you can edit and review. Minifying is for browsers: the smallest file that does the same job. Keep the readable version as your source and minify a copy for production. The CSS minifier explains what minifying changes.