Advertisement

CSS Beautifier / Minifier

Re-indents CSS based on brace nesting (handles already-minified one-line input, not just pre-formatted files) and minifies by stripping comments plus redundant whitespace. The minifier never touches a space that's semantically significant — a descendant combinator like .a .b and a compound selector like .a.b are different selectors, and a shorthand value like margin: 1px 2px needs that middle space — so only whitespace immediately touching { } ; : , gets removed. It won't merge properties or shorten color values like a dedicated tool (e.g. cssnano) would.

Input CSS
Output
Advertisement