Skip to content
FreeRuns in your browser

CSS Minifier

Minify CSS to shrink your stylesheets, or beautify minified CSS back into readable code.

Use the CSS Minifier

Loading tool...

What is the CSS Minifier?

CSS minification removes everything a browser does not need to apply the styles: comments, line breaks, indentation, the last semicolon in a rule and spaces around braces and colons. The result behaves identically but is typically 15 to 40 percent smaller, which means faster downloads and a quicker first render, especially on mobile networks.

Minification is one part of a performance strategy, alongside server compression (gzip or Brotli), caching and removing unused rules. Keep your readable source in version control and minify only the file you ship. If you ever need to read a minified stylesheet, the beautify mode reconstructs a tidy layout with one declaration per line.

When to use the CSS Minifier

Minify CSS before deploying a stylesheet that is not already handled by a build pipeline: a WordPress child theme, a landing page, an embedded widget or an email template. Smaller files improve Core Web Vitals such as Largest Contentful Paint because the browser can download and parse the render-blocking stylesheet sooner. The beautify mode is equally helpful when you inherit a minified file from a vendor and need to understand or adjust a few rules without hunting for the original source.

How to use the CSS Minifier

  1. Paste your CSS into the input panel.
  2. Choose Minify to compress or Beautify to expand.
  3. Check the size comparison to see how many bytes you saved.
  4. Copy the output or download it as styles.min.css.
  5. Test the page to confirm that nothing visual has changed before deploying.

Examples

Source (118 bytes):

/* Buttons */
.btn {
  color: #ffffff;
  background-color: #0066cc;
  padding: 8px 16px;
}
.btn:hover { background-color: #0052a3; }

Minified:

.btn{color:#fff;background-color:#06c;padding:8px 16px}.btn:hover{background-color:#0052a3}

Common errors and tips

  • Keep important license comments (/*! ... */) if your library licence requires attribution.
  • Do not remove the whitespace inside calc(): calc(1px + 2px) needs spaces around + and -.
  • Combine files first; fewer requests often matter more than a few extra bytes saved.
  • Use source maps in production builds so browser dev tools can show the original line numbers.
  • A syntax error such as a missing brace can swallow every rule after it; validate the source before minifying.

Privacy: runs entirely in your browser

Your stylesheet is processed locally in the browser tab; proprietary design code is never transmitted. This tool runs entirely in your browser: nothing you enter is uploaded, stored or logged on our servers, and it keeps working even if you go offline after the page has loaded.

Frequently asked questions

Is minified CSS safe?

Yes. Minification only removes characters that do not affect rendering, so the page should look identical.

How much smaller will my CSS get?

Typically 15 to 40 percent, depending on how many comments and how much indentation the source has. Gzip or Brotli on the server saves even more on top.

Can I get my original formatting back?

Not exactly: comments are lost. The beautify mode restores readable layout, but you should keep the original source file.

Does it merge duplicate rules?

This tool compresses syntax only. Merging and removing unused rules is done by build tools such as PurgeCSS or cssnano.

Ratings & reviews

–

0 reviews

5 star
0 reviews (0%)
4 star
0 reviews (0%)
3 star
0 reviews (0%)
2 star
0 reviews (0%)
1 star
0 reviews (0%)

No reviews yet — be the first to share your experience.

Write a review

Reviews are moderated before they appear.

Your rating *

Photos or videos (optional)

Drag files here or

JPG, PNG, WebP, GIF up to 5 MB. MP4 or WebM up to 25 MB.

  • Featured

    Beautify, minify and validate JSON instantly, with exact line and column for every syntax error.

    Use tool
  • Featured

    Encode text to Base64 or decode Base64 back to readable UTF-8, including URL-safe Base64.

    Use tool
  • Featured

    Generate random v4 and time-ordered v7 UUIDs in bulk, with one-click copy and format options.

    Use tool
  • Regex Tester

    Developer

    Featured

    Test JavaScript regular expressions live, with highlighted matches, capture groups and flag toggles.

    Use tool
  • JWT Decoder

    Developer

    Featured

    Decode JSON Web Tokens to inspect the header, payload and expiry, all without sending the token anywhere.

    Use tool
  • Featured

    Convert Unix timestamps to readable dates and back, in UTC or your local timezone, in seconds or milliseconds.

    Use tool