AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I minify CSS?

Paste CSS or drop a .css file into AnyTool's CSS Minifier and it shrinks the file with a structural optimizer, showing the bytes saved. You can also beautify minified CSS. Everything runs in your browser — your stylesheet is never uploaded.

  • Structural minification (rule merging, value shortening)
  • Beautify/un-minify mode with indentation control
  • Live compression stats and gzip-size estimate
  • 100% in your browser — no upload, no signup, free

What is

CSS Minification

CSS minification reduces stylesheet size by stripping whitespace and comments and, with a structural optimizer, merging rules and shortening values (like rgb to hex) — producing smaller files that load faster, with no change to how the page renders.

Developer Tools

Related terms

CSS OptimizationBeautifyGzip SizeStylesheet

How to Minify CSS

Minify or beautify CSS entirely in your browser with live stats.

10 secWeb browser
  1. 1

    Add CSS

    Paste your CSS or drop a .css file.

  2. 2

    Pick a mode

    Choose minify for the smallest output or beautify to reformat.

  3. 3

    Copy or download

    See the bytes saved and copy or download the .min.css.

Result: Minified or beautified CSS

Frequently Asked Questions

No — minification runs in your browser, so your stylesheet is never uploaded.

AnyTool minifies CSS locally with a bundled optimizer (no runtime CDN), so it works offline and your code never reaches a server — unlike server-side tools that POST your CSS to an API.

Yes — it uses a structural optimizer that merges rules and shortens values for smaller output.

Beyond removing whitespace and comments, the optimizer restructures selectors, merges declarations, and shortens color/value syntax, producing materially smaller files than naive whitespace strippers.

Yes — switch to beautify mode to re-indent and format CSS for readability.

A beautify mode reformats minified or messy CSS with your chosen indentation, so the same tool handles both directions.

Detailed Explanation

Methodology

How CSS Minification Works

AnyTool minifies CSS with csso, a structural optimizer that goes beyond stripping whitespace and comments — it merges declarations and rules, shortens values (such as rgb to hex), and restructures selectors for materially smaller output. A beautify mode (Prettier-standalone) reformats CSS for readability. The engine is bundled at build time (no runtime CDN) and runs in a Web Worker for large files, with a gzip size estimate computed locally via CompressionStream. Stylesheets are never uploaded.

  • csso structural optimizer — rule merging & value shortening
  • Beautify/un-minify mode with indentation control
  • Live compression stats and real gzip-size estimate
  • Runs in a Web Worker; bundled, no runtime CDN
  • No upload; works offline