CSS Formatter & Minifier
Format CSS with one declaration per line, or minify it for production.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the css formatter & minifier
- Paste your CSS.
- Choose Format or Minify.
- Copy or download the result.
About this tool
Formatting puts each selector and each declaration on its own line, adds the space after every colon, and indents nested blocks such as media queries. Strings and URLs are left alone, so a brace inside <code>url("a{b.png")</code> does not throw the indentation off.
Minifying removes comments and collapses whitespace around the structural characters. It typically saves 15–30% before gzip, and rather less after — gzip is very good at repetitive text, so minification matters most for the parse step and for files served without compression.
Common uses
- Making a minified stylesheet readable while debugging.
- Normalising CSS copied from several sources.
- Compressing a small stylesheet before inlining it.
Frequently asked questions
- Does minifying change how my CSS behaves?
- No. Only comments and insignificant whitespace are removed. Selectors, declarations and their order are untouched, so specificity and the cascade are unaffected.
- Does it add vendor prefixes or optimise properties?
- No. It is a formatter, not a build tool — nothing is added, removed or rewritten. Use a preprocessor or Autoprefixer for that.
Related tools
HTML Formatter & Minifier
Indent messy or minified HTML so it can be read, or strip it back down to one line.
CSS Gradient Generator
Build linear and radial CSS gradients visually and copy the generated background property.
XML Formatter & Minifier
Indent XML to reveal its structure, or minify it back to a single line.
JSON Formatter
Format, validate and minify JSON with clear error messages that point at the exact position.