Boneyard Tools

CSS Minifier

Paste CSS to strip comments and whitespace and shrink the file. Minification runs entirely in your browser, and your strings and url() values are preserved exactly.

How to minify CSS

  1. Paste your CSS into the editor.
  2. The minified output and size savings update instantly.
  3. Copy the result or download it as a .css file.

Examples

Strip comments and whitespace

/* card */
.card {
  color: red;
  margin: 0;
}
.card{color:red;margin:0}

Frequently asked questions

Is my CSS uploaded to a server?

No. Minification happens entirely in your browser, so your CSS never leaves your device.

How does the minifier shrink my CSS?

It removes comments and collapses whitespace, then drops spaces around braces, colons, semicolons and commas, including the last semicolon before a closing brace.

Will it break my content or url() values?

No. Text inside quoted strings and url() is preserved exactly, so spacing in content values and file paths stays intact.

Does minified CSS still work the same?

Yes. Minification only removes characters browsers ignore, so the rules and their meaning are unchanged.

How much smaller will my file get?

It depends on how many comments and how much whitespace you have. The tool shows the original size, minified size and percent saved.

Related tools