Shard Tools

CSS Minifier

Minify CSS instantly in your browser.

Maintained by Roshan.

Use CSS Minifier

Converts css to minified css in this tab, with nothing sent anywhere.

Runs entirely on your deviceThe conversion happens in this browser tab. Nothing you type is uploaded, logged or stored, which is worth knowing for anything you would not paste into a search box.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About CSS Minifier

A CSS minifier strips comments and whitespace from a stylesheet, shrinking it to the compact single-line form that production sites serve to load faster. Every byte of CSS is downloaded on every page load, so removing the spaces, newlines and comments that only exist for human readers is a simple, real performance win. This tool minifies your CSS in the browser, removing comments and collapsing whitespace while leaving the styling identical. Because it runs on your device, a proprietary stylesheet is minified without being uploaded to a third-party service. It is a quick win for a hand-built site with no bundler, or for a snippet of critical CSS you want to inline into a page's head without the newlines bloating the HTML. The saving is small per file but real across every visit, and unlike a full build step it is instant and needs nothing installed.

Using CSS Minifier

  1. Paste your CSS. It is minified in this browser tab.
  2. Comments are removed, whitespace around braces, colons and semicolons is collapsed, and the final semicolon before each closing brace is dropped.
  3. Copy the compact result, ready to ship or embed, smaller than the readable version by every space and comment removed.

Where css minifier helps

Shipping a small stylesheet

A hand-written stylesheet is minified before deploy, shaving its download size with no change to how it renders.

Inlining critical CSS

Minified CSS is compact enough to inline into a page's head without bloating the HTML.

Keep a source version for debugging

Retain the readable stylesheet and compare the generated CSS in the page that uses it. Minification makes line-based error reports less helpful and does not remove unused selectors, combine network requests or replace asset caching. A smaller character count is only one part of delivery size; inspect the compressed network response when measuring the actual download saving.

Before you use the result

Questions about CSS Minifier

Does minifying change how the page looks?

No. Only comments and whitespace are removed, so the rendered result is identical.

Is this as good as a build tool?

For a single file, yes. Large projects benefit from a bundler that also merges and renames, but this is instant for one stylesheet.

Related tools

CSS Formatter

CSS Formatter in your browser. Instant, accurate, and nothing is uploaded.

SQL Minifier

SQL Minifier in your browser. Instant, accurate, and nothing is uploaded.

HTML Entity Decoder

Decode HTML entities back into plain text in your browser, including numeric and named forms.