CSS Minifier

Strip whitespace and comments to ship smaller stylesheets.

Processed locally — nothing is uploaded

About Code Formatter

Useful for making a minified payload readable again, for checking that a config parses before you ship it, or for stripping a file down for production. Switching language keeps whatever you have already pasted.

Strip the comments, whitespace and line breaks out of a stylesheet to ship a smaller CSS file that downloads and parses faster. Paste your CSS and copy the minified output — it is compressed in your browser and never uploaded.

Paste messy or minified code and instantly beautify, minify or validate JSON, HTML, CSS, SQL, XML and YAML. Beautifying re-indents your source with consistent spacing so it is easy to read and review; minifying strips whitespace and comments to ship smaller files; validating surfaces syntax errors with the exact location so you can fix them fast.

It also doubles as a converter between common data formats — JSON to CSV, CSV to JSON, YAML to JSON and back — which is handy when wiring up APIs, configs or spreadsheets. Converting is where structure mismatches surface: CSV has no nesting, so a nested JSON object has to be flattened or dropped.

Learn how this works

Frequently asked questions

How much smaller will my CSS get?

It depends entirely on how the source is written. Heavily commented, generously indented stylesheets often shrink substantially, while output from a build tool that already strips whitespace may barely change. Minification removes comments, indentation and line breaks — it does not rewrite your selectors.

Will minifying break my stylesheet?

No. Only characters CSS treats as insignificant are removed, so the parsed rules are identical. The one thing to watch is that comments are gone, including licence headers you may be required to keep — preserve those separately.

Should I minify if my server already uses gzip or Brotli?

The gain is smaller, because compression already handles repeated whitespace well, but it is not zero — minified CSS is smaller both on the wire and in memory after decompression. For most sites the real win is compression; treat minification as the cheap extra.

Pro Tips

  • Paste unformatted JSON, HTML, CSS, or SQL code and apply consistent indentation (2, 4, or tab spaces) in one click.
  • Use minification toggle to reduce code size by 30-50% for production deployment or email constraints.
  • Export formatted code directly to clipboard to paste into documentation, emails, or config files instantly.
  • Compare formatted vs minified side-by-side to verify code compression doesn't break syntax.

Common Use Cases

  • Shrinking a hand-written stylesheet before uploading it to a site with no build step
  • Trimming critical CSS that gets inlined into the document head
  • Checking how much of a stylesheet's size is comments and formatting

How It Compares

While Prettier and VS Code extensions require installation and configuration, our web-based formatter works instantly on any device without setup, offering broader language support (HTML, CSS, SQL) in a single tool compared to language-specific formatters like Beautifier.io.

More Code Formatter tools

Related tools