Skip to content

CSS Minifier

Minify CSS in your browser with exact byte measurements. Level 2 merging is opt-in and clearly labelled because it can reorder declarations.

Paste CSS

Level

Minified CSS

Paste CSS, choose the level, then minify.

The minified CSS appears here, with exact byte savings.

Limit for uploaded files: 2 MB. Pasted text is not truncated by the tool — your browser’s memory is the ceiling.

Your file is never sent to a server. It is read and processed by your own browser, and the results are not stored.

How to use it

  1. Paste CSS, or choose a .css file.
  2. Leave level 1 alone unless you know your cascade is tolerant of merging.
  3. Minify, check the byte savings, then copy or download the result.

Limits worth knowing

  • Level 2 is opt-in and can change cascade outcomes — test before shipping.
  • Parse errors are reported verbatim with the library’s own message.
  • Vendor-specific hacks may be normalised away; keep the source in version control.
  • Files above 2 MB are refused to keep the tab responsive.

Level 1 versus level 2

Level 1 is safe: it removes bytes and keeps the meaning. Level 2 reorders declarations and merges rules, which is legal CSS but can outrank or undercut your specificity in subtle cases. When in doubt, ship level 1 — the difference is usually a handful of bytes.

Custom properties are not glued to their definitions, so minifying a stylesheet with extensive theming at level 1 is the conservative choice.

What the sizes mean

The before/after figures are exact encoded bytes, not characters, so the percentage respects multibyte content in comments or strings.

Frequently asked questions

Does CSS Minifier upload my files to any server?

No. CSS Minifier runs in your browser, and the file is read there rather than sent to a server for processing. Our host still sees ordinary page-request metadata, which is described on the privacy page.

Is CSS Minifier free to use?

Yes, CSS Minifier is free, with no paid tier, no account, and no watermark added to your output. The limits are technical rather than commercial: file size, page count and supported formats are listed on this page.

What file formats and sizes are supported?

CSS Minifier supports .css, .txt files up to 2MB directly in your browser.

What is the difference between level 1 and level 2?

Level 1 removes whitespace, zero units and duplicates while preserving declaration order and selector structure. Level 2 additionally merges selectors and reorders declarations, which can change which rule wins in edge cases. Level 2 is never on by default.

Will it break my calc() and custom properties?

No. clean-css preserves calc() expressions and custom property definitions and values. It may reduce zero units and convert colours, which is what you asked of a minifier.

Does it validate my CSS?

It reports errors and warnings from the parser with context. A clean result means the CSS tokenised successfully; it does not guarantee your browser paints what you expect.

Is my file uploaded?

No. Everything runs in this tab; the file stays on your device.