Developer Tools

CSS Formatter & Minifier

Format (beautify) or minify CSS — safely, entirely in your browser.

CSS Formatter and Minifier Tool

Format or Minify CSS

How to Use This Tool

  1. Paste your CSS into the input box, or click "Load Sample" to try an example.
  2. Choose Format (to reformat it readably) or Minify (to shrink it).
  3. Click the action button.
  4. Copy the result.

Example

Input:

body{margin:0;padding:0;color:red;}

Formatted:

body {
  margin: 0;
  padding: 0;
  color: red;
}

What "Safe Minification" Means Here

This tool removes comments and unnecessary whitespace -- it does not rename, reorder, or merge your rules. Strings, URLs, custom properties, and media queries are all handled correctly and never corrupted.

Frequently Asked Questions

What does "Format" do?

It reformats your CSS with consistent indentation: each rule's declarations sit on their own line, one level deeper than the selector, the same way a hand-formatted stylesheet would look.

What does "Minify" actually remove?

Comments and unnecessary whitespace -- extra blank lines and spacing around punctuation like braces, colons, and semicolons. It does not rename anything or restructure your rules.

Does this handle media queries correctly?

Yes -- a @media block is just a nested set of braces to this tool's formatter, so it indents the rules inside it one level deeper, the same as any other nested block.

Does this handle CSS custom properties (variables)?

Yes -- a custom property like --main-color: #3355ff; is formatted and minified exactly like any other declaration, since its value is still protected the same way any other value would be.

Will this break a URL or string inside my CSS?

No -- quoted strings (used in content, font-family, and inside url("...")) are detected and protected before any whitespace or comment removal happens, so their contents are never altered.

Is my code sent anywhere?

No. Every transformation runs locally in your browser using JavaScript. Nothing you paste here is sent to Brekzy or stored anywhere.

Find More Useful Tools

Explore Brekzy's growing collection of free calculators, converters, AI tools, and practical resources.