Beautify and compress CSS code online.
Reformat CSS spacing while protecting quoted strings, comments, escapes and parenthesized expressions.
Paste CSS, choose format or minify, and compare the result in your stylesheet before publishing.
The value calc(100% - 2px) and a quoted content string retain their internal spaces. A descendant selector such as 'a :hover' retains its meaning.
This lightweight tool does not validate CSS or replace a standards-aware production optimizer. It preserves comments and does not resolve imports, variables or browser compatibility.
CSS formatting and minification run locally in your browser. The tool does not submit your stylesheet to an external CSS processing API. Copying places the result on your device's clipboard.
CSS controls the appearance of web pages, including colors, spacing, typography and responsive layouts. Readable CSS can make stylesheets easier to inspect and maintain. This tool offers two operations: formatting and minification.
Formatting adds line breaks and spacing to make CSS declarations easier to read.
.card{color:red;padding:10px}
.card {
color:red;
padding:10px
}
The formatter separates declarations onto different lines. It does not automatically apply every formatting convention used by professional CSS code formatters.
Minification removes selected unnecessary spaces and line breaks to produce a more compact stylesheet.
.card {
color: red;
padding: 10px;
}
.card{color: red;padding: 10px;}
This lightweight minifier reduces some whitespace. It does not rename selectors, remove unused rules or perform advanced production optimizations.
Use formatting when reading unfamiliar stylesheets, debugging layout problems, learning CSS or preparing code for review by another developer.
Use minification when you want a more compact representation of your styles. For production projects, consider a standards-aware CSS build tool that provides comprehensive optimization and validation.
CSS may contain values where spaces and punctuation are meaningful. The tool uses a protection helper to shield common quoted strings, comments, escaped characters and parenthesized expressions during text transformations.
.badge::after{content:"Hello; world"}
The semicolon inside the quoted string is part of its content and should not be treated as a declaration separator.
.box{width:calc(100% - 2px)}
The helper protects the parenthesized expression so that its internal spacing is not rewritten by the formatter or minifier.
Comments are preserved by this tool, including during minification. The minifier is not designed to remove documentation comments.
This tool uses lightweight text transformations rather than a complete CSS syntax parser. It does not validate CSS properties, check browser compatibility or automatically repair invalid rules.
Complex nesting, unusual syntax and advanced CSS features may require manual review. Always test the processed stylesheet before using it on a production website.
Keep a copy of your original CSS so you can compare the output or restore an earlier version.
CSS processing takes place locally inside your browser. Formatting and minification do not require sending the entered code to an external CSS conversion service.
When you select Copy, the resulting CSS is placed on your device's clipboard. Clipboard access depends on your browser and operating system.
Yes. You can format, minify and copy CSS without paying for the tool.
No. Formatting changes the layout of the text. It does not validate CSS syntax or correct invalid property values.
No. This tool preserves CSS comments. It focuses on selected whitespace transformations.
The protection helper shields parenthesized expressions, including common calc() expressions, from the spacing transformations.
Review and test the result when working with complicated CSS.
Yes, you can enter CSS containing media queries. However, this tool does not implement a full syntax-aware indentation system for nested CSS.
Not necessarily. The result depends on the original CSS. This tool does not implement every possible size optimization.
The formatting and minification functions process the text in your browser without submitting it to an external CSS processing API.