CSS Minifier
Minify CSS by removing comments, whitespace and redundant characters.
Tidy stylesheets into a consistent, readable shape.
CSS Formatter expands a stylesheet into a consistent shape: one selector per line, one declaration per line, a space after each colon, and a semicolon on every declaration including the last. Minified CSS becomes readable again, and inconsistently written CSS becomes uniform.
Nested structures are handled properly. Media queries, supports blocks, keyframes and layers all indent their contents one level further, which is what makes a long responsive stylesheet navigable. Comments are preserved in place rather than being stripped, because a comment that moves is worse than no comment.
The formatter changes whitespace and nothing else. Property order, selector specificity and values are left exactly as written, so the formatted file behaves identically to the original and a diff shows only what you expect.
The css formatter is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
No. Only whitespace changes. Selector order, specificity and values are untouched, so the formatted stylesheet behaves exactly like the original.
Yes, in place. Comments often explain why a rule exists, and a formatter that discards or relocates them destroys information that cannot be recovered.
The query stays on its own line and the rules inside it are indented one level further, which is what makes the structure of a responsive stylesheet readable at a glance.
The tool reports them rather than guessing. An unbalanced brace in CSS silently swallows every rule after it, so finding it is usually the whole reason you came.
No. Merging duplicate properties or shorthanding values changes meaning in ways that depend on context, so the formatter leaves those decisions to you.
No. Everything runs in your browser.
If the css formatter is not quite what you need, these other free tools solve closely related problems.
Minify CSS by removing comments, whitespace and redundant characters.
Pretty-print HTML with consistent indentation, or collapse it back down.
Format JavaScript with consistent indentation, spacing and statement breaks.
A three-pane editor with a live preview that updates as you type.
Design linear and radial gradients with live preview and copyable CSS.