What this tool does
Compact simple CSS text with whitespace substitutions. The component removes block comments, collapses whitespace, removes spacing around selected punctuation and drops a semicolon immediately before a closing brace. Savings are based on JavaScript character counts, not compressed network bytes.
How to use CSS Minifier
- Prepare the input. Paste simple CSS and retain an original copy.
- Run or configure the tool. Review the automatic compact output and character counts.
- Check and use the output. Test it in the real stylesheet before copying.
How this tool works
The component removes block comments, collapses whitespace, removes spacing around selected punctuation and drops a semicolon immediately before a closing brace. Savings are based on JavaScript character counts, not compressed network bytes.
Worked example
Input: a { color: red; }
Output: a{color:red}
Limits, assumptions and interpretation
This is regex-based text compaction, not a CSS parser or production optimizer.
- Whitespace inside quoted content, calc() expressions, data URLs or unusual syntax can be changed incorrectly.
- Keep the original and test the CSS in its target page; use a parser-based build tool for production code.
- No minification result proves that styles remain equivalent.
Supported inputs and limits
- a { color: red; }
- This is regex-based text compaction, not a CSS parser or production optimizer.
- Whitespace inside quoted content, calc() expressions, data URLs or unusual syntax can be changed incorrectly.
- Keep the original and test the CSS in its target page; use a parser-based build tool for production code.
- No minification result proves that styles remain equivalent.
Frequently asked questions
What does this tool actually do?
The component removes block comments, collapses whitespace, removes spacing around selected punctuation and drops a semicolon immediately before a closing brace. Savings are based on JavaScript character counts, not compressed network bytes.
What should I check before using the result?
This is regex-based text compaction, not a CSS parser or production optimizer. Whitespace inside quoted content, calc() expressions, data URLs or unusual syntax can be changed incorrectly. Keep the original and test the CSS in its target page; use a parser-based build tool for production code. No minification result proves that styles remain equivalent.
Is information sent to a server?
Tool inputs are processed in this browser. This product does not use analytics or send your input to an external API. Clicking an external website link still visits that website.