InTab

CSS Minifier

Minify CSS with CSSO: remove whitespace, merge rules and shorten values.

Formatters: Pretty-print, minify, validate and compare. It runs in your browser, so nothing you enter is uploaded.

What it does

The CSS Minifier makes stylesheets smaller with CSSO. Beyond removing whitespace and comments, it shortens values (such as #ffffff to #fff and 0px to 0) and can merge rules that share declarations. The result shows the bytes saved.

How to use it

  1. Paste CSS into Input, or click Sample.
  2. Click Minify.
  3. Leave Merge rules on for the smallest output; turn it off to keep your rules in their original order and grouping.
  4. Copy or download the result.

Example

.btn {
  color: #ffffff;
  margin: 0px 0px 0px 0px;
}
.link {
  color: #ffffff;
}

Minified with Merge rules:

.btn{margin:0}.btn,.link{color:#fff}

Good to know

  • Merging rules is safe in almost every case, because CSSO only moves rules where the cascade result stays the same. Turn it off if you rely on a very specific order for debugging.
  • Comments starting with /*! are kept, so licence notices survive.
  • Serve the minified file compressed with gzip or Brotli for the smallest download.

FAQ

Can I undo minification? The CSS Formatter restores readable layout. Merged rules stay merged.

Does it remove unused CSS? No. It cannot know which selectors your pages use. That needs a tool that scans your HTML.

More Formatters tools

  • JSON Formatter: Beautify, minify, validate and sort JSON. Handles escaped/stringified JSON.
  • XML Formatter: Beautify, minify and validate XML documents.
  • SQL Formatter: Format SQL for MySQL, PostgreSQL, T-SQL, SQLite and more.
  • Diff Finder: Compare two texts or JSON documents line by line or word by word.
  • Text Diff Checker: Paste two versions of a text and see exactly which words changed.
  • JSON Validator: Check JSON is valid and see the exact line, column and a fix hint when it is not.
  • JavaScript Formatter: Beautify minified or messy JavaScript with your choice of indentation.
  • JavaScript Minifier: Minify JavaScript with Terser: compress, shorten names and see the size saved.
  • HTML Formatter: Indent and tidy HTML, or minify it for production.
  • CSS Formatter: Beautify CSS with one rule per block and consistent indentation.
  • YAML Formatter: Validate and re-indent YAML, keeping comments, with optional key sorting.