CSS minifier and beautifier: practical guide
Use this tool to compact CSS structure for delivery or format a stylesheet for reading and maintenance. It parses CSS with a locally hosted PostCSS engine and returns source text. It does not apply the CSS to this page, fetch URLs from declarations, compile preprocessors or provide a live style preview. Choose the related HTML viewer to inspect a page separately.
How to format or minify CSS
Paste a stylesheet without HTML style tags. Choose 1 to 8 spaces for beautification, or use the license-comment option for minification, then run the desired operation. The output is separate from your input. Editing source or options clears stale output and byte counts. Stop cancels the current task; Clear removes both panes. A stylesheet consisting only of removable comments can produce a successful empty result.
What conservative minification preserves
The tool reduces spacing around CSS structure without rewriting selectors, declaration value tokens or at-rule parameters. It does not merge rules, reorder declarations, shorten colors or evaluate math. This protects descendant selectors, escaped names, calc expressions, data URLs and custom property token sequences from character-based substitutions. Inline comments within selectors, values or property separators may remain to preserve their token boundaries. Review output against your actual stylesheet and browser targets.
.card {
width: calc(100% - (2 * 1px));
color: red;
}.card{width:calc(100% - (2 * 1px));color:red}Comments, licenses and formatting
Beautification retains all comments. During minification, the enabled license option retains standalone comments that start exactly with /*!; ordinary standalone comments are removed. Disabling it also removes those license comments, so check your redistribution obligations first. Embedded token comments may remain regardless of this option. Source-map annotations are not regenerated. Formatting changes structural indentation and colon spacing but keeps value content, declaration order and supported legacy property prefixes.
Modern CSS and syntax error boundaries
Nested rules, custom properties, layer and container blocks are handled as CSS structure rather than by splitting on every brace or semicolon. The parser reports structural syntax errors with line and column, including many unclosed strings, comments and blocks. Successful parsing does not verify every selector, property value, feature or browser version. Sass, SCSS and Less are not compiled. Test the result in the browsers and build process that will use it.
Reading UTF-8 size statistics
Input and output counts are UTF-8 encoded bytes of the text in the editor, not JavaScript string lengths. The tool reports reduced size, increased size or no change; empty output is counted as zero bytes. These are uncompressed text sizes, not gzip or Brotli transfer sizes. Beautification usually adds bytes, and conservative serialization does not guarantee smaller output. Browser textareas can normalize line endings, so the counts need not match an original file byte for byte.
Local processing and limits
Processing runs in a separate module Worker with a 3-second deadline including startup. Limits are 100,000 input UTF-16 units, 20,000 CSS nodes, 60 nesting levels and 1,000,000 output units. Larger value tokens can reach the text limit before the node limit. The tool does not upload CSS or store it in browser storage; shared website resources still load. The site must serve the main script, Worker, engine and local parser files. A blocked Worker produces an error rather than running the parser on the page.