CSS Minifier
Minify CSS by removing comments and spaces
Start
.selector{color:red;padding:0}Description
The CSS Minifier compresses styles by stripping comments and collapsing unnecessary whitespace. It’s ideal for quick snippets and experiments.
You can choose to preserve the first comment (often used for licenses) and tune whitespace behavior.
Key features
- Remove block comments
- Collapse whitespace around punctuation
- Option to preserve the first comment
- Local, fast, and safe
Common use cases
- Sharing compact style snippets
- Testing stylesheet size differences
- Embedding styles in HTML
Privacy & security: processing runs in your browser only.
How to Use
- Paste CSS in the left panel.
- Toggle “Preserve first comment” as needed.
- Review minified output and copy when ready.
- Use “Sample” to load a demo snippet.
Tips
- Keep license headers by preserving the first comment.
- Verify rendering if whitespace is significant in values.
Troubleshooting
- Output seems broken → This is a naïve minifier; avoid production use.
- Comments needed → Enable preservation of the first comment.
Example
Example: Whitespaces
Input:
.btn { color: red; padding: 0; }Output:
.btn{color:red;padding:0}FAQ
Local and safe?
Yes. Runs in your browser.
Production ready?
No. Use build tools for robust minification.
How to keep license?
Enable “Preserve first comment”.