Compact repeated CSS spacing while preserving strings, comments, escaped characters and custom-property values. Use this conservative browser tool for small stylesheet snippets and review the result before deployment.
How to compact CSS
- Paste a stylesheet or choose Load Sample.
- Select Minify Code. Check the output and the number of characters saved.
- Copy the result and test it with the page that uses the stylesheet.
Example
.card { color: red; } becomes .card { color: red; }. A value such as content: "a b" keeps both spaces inside its string.
What is preserved
Quoted strings, CSS comments, escaped identifiers, function arguments such as calc() and url(), attribute-selector payloads and custom-property values are retained. In particular, spaces around arithmetic operators in calc() are not removed.
Limits and troubleshooting
This tool compacts spacing; it does not perform semantic optimizations, merge selectors, shorten colors, remove declarations or remove comments. It reports unclosed comments, strings and unbalanced brackets, but it is not a complete CSS validator. An unchanged result is normal when the source is already compact or consists mostly of protected values.
Privacy
The stylesheet is processed locally as text. It is not inserted into the page or uploaded.
Frequently asked questions
Does the tool alter quoted content?
No. Quoted values and their escape sequences are kept unchanged, including repeated spaces.
Will calc() or custom properties be changed?
Function arguments and custom-property values are preserved. This includes required spacing around calc() operators and whitespace inside custom values.
Why are comments still present?
This conservative mode preserves comments so that licenses, directives and token boundaries are not accidentally changed.
Explore Related Text Tools
Use the CSS Minifier Now
Paste your text above, adjust the settings if needed, and generate a clean browser-side result in seconds.
Back to Tool