CSS Formatter & Minifier - Format or Minify CSS Online
Format or minify CSS
Paste CSS and choose Format or Minify. Format puts each declaration on its own line, indents rules inside
@media and other at-rules, and adds a blank line between rules. Minify strips comments and whitespace. The
original and output sizes appear under the editor.
Example
Minifying
.card {
color : red ;
margin: 0 0 0 0;
}
/* unused */
.badge {} gives .card{color:red;margin:0 0 0 0}.badge{}.
Note what it does not do: 0 0 0 0 is not shortened to 0, empty rules are kept, and colours are not
rewritten. That is whitespace and comment removal only. For a production build, a minifier such as cssnano or Lightning CSS
in your bundler does those extra rewrites.
Strings and url() values are copied as they are in both modes. To tidy markup, use the
HTML formatter.
Related Tools
Epoch / Unix Timestamp Converter
Convert between Unix epoch timestamps and human-readable dates.
Regex Tester
Test regular expressions against text with match highlighting.
UUID Generator
Generate random v4 UUIDs for use in databases and APIs.
Colour Converter
Convert colours between HEX, RGB, and HSL formats.