🖌 CSS Minifier & Beautifier

Minify and format simple CSS. Runs 100% in your browser.

Last updated: November 8, 2026 · By the BoltQuickTools team

Squeezing or expanding a stylesheet by hand

Sometimes you have a one-line minified file you need to read, or a small snippet to shrink before pasting it into a CMS or email template. This page does that with a set of text replacements. It is meant for quick jobs and not as a step in a build.

Controls

  1. Paste into Input CSS, or click Sample CSS for an example, which is beautified straight away.
  2. Click Minify or Beautify. For Beautify, choose 2-space or 4-space first, because the choice only applies on the next click.
  3. Read Output CSS and the size figures below it, then click Copy Output.

A small example

Input:

/* card */
.card {
  color: #333333;
  margin: 0 auto;
}

.card:hover,
.card:focus {
  color: #000;
}

Minify returns the following and reports Original: 101 B, Minified: 69 B, Saved: 32 B (31.7%).

.card{color:#333333;margin:0 auto}.card:hover,.card:focus{color:#000}

It removes comments, line breaks, repeated spaces, spaces around punctuation and the last semicolon in a block. That is all it does. #333333 is not shortened, 0px stays as written, and duplicate or empty rules remain.

Cases where Minify changes the meaning

The tool does not parse CSS, so it cannot tell a selector from a string. Each of these was produced by the page's own code:

InputOutputProblem
.a and .b { color: red } on two lines.a.b{color:red}Unindented line break removed, so a descendant selector becomes a compound one
.nav :first-child { color: red; }.nav:first-child{color:red}Space before the colon removed, so it selects something else
@media screen and and (min-width: 600px) {...} on two lines@media screen and(min-width:600px){...}The missing space makes the query invalid
content: "x : y /* z */";content:"x:y ";Text inside the string is altered

License comments such as /*! MIT */ are removed as well. Keep any notice your license requires. Indent continuation lines to avoid the first and third cases.

Cases where Beautify damages the code

Neither button validates anything. Unbalanced braces still report success.

Build tools, size limits and gzip

Should I use this for production files?

For a site with a build step, no. A parser-based tool such as cssnano or esbuild avoids all of the cases above and shrinks values too. After using this page on anything you care about, compare before and after in the code diff viewer.

Is there a size limit?

The code sets none. Everything is done with regular expressions in the tab.

How much more does gzip save?

Servers normally compress CSS on top of this. To see the combined effect on your file, run the minified output through the gzip tool. Similar pages exist for JavaScript and HTML.