Skip to content

Developer Tools

CSS Formatter & Minifier

Format or minify CSS stylesheets in your browser with payload reduction statistics and zero server processing.

Input Stylesheet225 characters
Processed Output0 characters

Why Minified CSS Is Not Just Shorter

Beyond stripping whitespace and comments, minification collapses the last declaration in each rule (dropping the final semicolon), shortens zero values, and may merge identical rules — all safe, all invisible. What it will not do is fix specificity problems or reorder rules that override each other; cascade order is semantic. A 40% size reduction is typical for hand-written CSS, and the byte savings matter mostly on first load since stylesheets cache afterward.

What Minification Does and Doesn't Change

Minifying removes comments, line breaks and redundant spaces and the last semicolon in each block. Typical savings are 15 to 30 percent before compression, and less once gzip or Brotli is applied, because those already collapse repeated whitespace.

The gain is therefore real but modest. A bigger win usually comes from deleting unused rules. Keep the readable source in version control and minify as a build step, and use the formatter side when you need to read a stylesheet that someone else already compressed.

How the Tool Works

  1. Paste your CSS, including any bundled vendor prefixes.
  2. Select Minify to collapse rules into compact single-line form, or Format to expand them with consistent indentation.
  3. The stats panel compares the byte size before and after, showing the exact reduction percentage.
  4. Copy the result or download a .css file for direct use.

Example Input & Output

Minify a stylesheet for production
Input: 8.3 KB developer-formatted CSS
Output: 5.6 KB minified (−33%)
Smaller CSS downloads and parses faster, directly improving Largest Contentful Paint on content-heavy pages.
Format a condensed CDN snippet
Input: body{color:#111;font-size:16px}a{color:#0284c7}
Output: body { color: #111; font-size: 16px; } a { color: #0284c7; }
Expanding minified rules makes the cascade readable and maintainable for humans.

Common Questions

Does minification change behavior?

No. Only whitespace and comments that do not affect rendering are removed. Selectors, values, and at-rules are preserved exactly.

Are media queries and keyframes kept?

Yes. @media, @keyframes, and all other at-rules are preserved and formatted correctly in both modes.

Can I chain this with the HTML minifier?

Yes — minify your CSS here, embed or link it, then minify the surrounding HTML with the HTML minifier for the full pipeline.