Developer Tools
Live

CSS Minifier

Minify CSS by removing whitespace and comments.

Minify CSS by removing whitespace and comments.

Quick start: Paste your CSS source into the input area. → Click Minify to strip whitespace, line breaks, and ordinary comments. → Check the original size, minified size, and percentage saved.

How to use CSS Minifier

  1. 1

    Paste your CSS source into the input area.

  2. 2

    Click Minify to strip whitespace, line breaks, and ordinary comments.

  3. 3

    Check the original size, minified size, and percentage saved.

  4. 4

    Confirm any /*! license comments you need were preserved.

  5. 5

    Copy the compressed CSS, ready for production deployment.

Real examples of CSS Minifier in action

Whitespace and comment removed
Before
/* button */
.btn {
  color: #fff;
  border: 0;
}
After
.btn{color:#fff;border:0}
License comment preserved
Before
/*! v1.0 MIT */
body { margin: 0; }
After
/*! v1.0 MIT */body{margin:0}
Popular tools

Try our most-used tools

Who is CSS Minifier for?

Developers shipping CSS without a build pipeline

Email developers squeezing inline CSS under size limits

Site owners optimizing load time on key pages

Anyone compressing third-party CSS that arrived unminified

Why use CSS Minifier?

  • Strips whitespace, line breaks, and comments for the smallest safe output.
  • Preserves /*! license comments so legal attributions survive minification.
  • Shows original size, minified size, and exact percentage saved.
  • Produces a functionally identical file, so the page renders exactly the same.
  • Runs in your browser, so proprietary or client CSS is never uploaded.

Common use cases

  • Compress a stylesheet before deploying when you do not have a build step set up.
  • Inline minified CSS into an HTML email where every byte affects deliverability.
  • Shrink a third-party stylesheet that was only provided unminified.
  • Trim CSS on a performance-critical landing page to improve load time.

How CSS Minifier compares to alternatives

Honest comparison to other popular options — pick the right tool for the job.

ToolMain limitation
cssnanoFar more powerful but needs a Node build setup and config; overkill for a one-off file
RapidTables / generic minifier sitesAd-laden and tracker-heavy, and some upload your stylesheet to a server
Online CSS optimizers that auto-merge rulesCan change behavior with aggressive rule merging, which is riskier than plain whitespace removal
CSS MinifierFree, runs in your browser, no sign-up, no watermarks, no file-size limits beyond your device memory.

Limitations & things to know

  • Removes whitespace and comments only; it does not merge rules, shorten colors, or drop unused CSS
  • Savings are modest on stylesheets that are already compact

About CSS Minifier

A CSS minifier compresses a stylesheet by removing every byte that the browser does not need to render the page: spaces, tabs, line breaks, and comments. The CSS that is comfortable for a developer to write is full of indentation and explanatory comments, but the browser ignores all of it. Stripping that whitespace produces a functionally identical file that downloads faster, which directly improves page load time and Core Web Vitals. This tool removes redundant whitespace, collapses the stylesheet, and deletes comments, while preserving comments that begin with the /*! marker. That marker is the long-standing convention for license headers and legal attributions that must survive minification, so license notices stay intact. After minifying it shows the original size, the minified size, and the percentage saved so you can see the impact. A realistic expectation matters here. The savings come almost entirely from whitespace and comment removal, so heavily commented and deeply indented source shrinks the most, while already-compact CSS barely changes. This tool does not perform the deeper optimizations a build-time tool like cssnano does: it does not merge duplicate selectors, shorten hex colors (#ffffff to #fff), collapse longhand into shorthand, or remove unused rules. It is a fast, safe whitespace-and-comment minifier, not a full optimizer, which is exactly what you want when you need a quick production file without spinning up a build pipeline. Because all processing happens in your browser, your CSS is never uploaded, so proprietary or client stylesheets stay private. For the reverse operation, the CSS Beautifier expands a minified file back into readable form.

Frequently asked questions

No. Minification removes only whitespace and comments, which browsers ignore anyway. The rendered page is identical, just delivered in fewer bytes.
Yes. Comments that start with /*! are kept, which is the standard convention for license and legal notices that must remain in production files.
No. It removes whitespace and comments only. It does not merge duplicate selectors, shorten hex colors, collapse shorthand, or remove unused rules. For that, use a build tool such as cssnano.
Usually somewhere in the 20 to 40 percent range, driven mostly by how much whitespace and commenting the source contained. Already-compact CSS will shrink far less.

Your files never leave your device

Every tool on Xevon Tools runs 100% in your browser. No uploads, no servers, no tracking. Free forever.

Learn more

Embed CSS Minifier on your site

Add this tool to your own website, blog, or internal tool page with one line of code. Free to use, no attribution required (but appreciated).

<iframe src="https://www.xevontools.com/embed/minify-css" width="100%" height="640" style="border:1px solid #e2e8f0;border-radius:12px;" title="CSS Minifier — Xevon Tools"></iframe>
Share: