Minify or beautify CSS.
This tool turns CSS into a compact single line for production or into a neatly indented, readable layout for review. It is useful for front-end developers who need to shrink a stylesheet before pasting it into a page, or who received a minified file and want to read it. You can load a .css file, pick the indent width, and decide whether comments survive minification.
Minification removes everything the browser does not need to interpret a stylesheet: line breaks, indentation, spaces around braces, colons, commas and combinators, the last semicolon in a rule, and usually comments. The rules and their meaning stay the same, but the file gets smaller, so it downloads and parses faster. Beautifying is the opposite operation: it puts each selector and declaration on its own line, indents nested blocks such as media queries, and normalises spacing after colons and commas. Strings and comments are protected during both operations so their content is never altered by the whitespace rules. This tool applies simple whitespace-based rules and does not merge selectors, shorten colors or reorder properties.
It should not. Only whitespace, the last semicolon of each rule and (by default) comments are removed. Quoted strings are protected. Still, test the result in your page, especially for unusual syntax, because the tool uses simple text rules rather than a full CSS parser.
No. The tool does not rewrite values, convert #ffffff to #fff, merge duplicate selectors or reorder declarations. For that level of optimisation use a dedicated build-time optimiser.
Tick Keep comments (minify) before pressing Minify. The comments are then kept in the compact output. When the box is off, all block comments are removed.
Indent sets whether Beautify uses 2 spaces or 4 spaces per nesting level. It has no effect on Minify.
Yes. Use the file button next to the input to load a .css file, then run Beautify or Minify. The output can be copied or downloaded as styles.css.