CSS Minifier & Beautifier

Minify CSS for production, beautify minified CSS so you can read it, check that braces balance, or convert between CSS, LESS, SCSS, SASS and Stylus. Your stylesheet never leaves the browser.

What you can do here

Each operation has its own link: ?mode=minify, ?mode=beautify, ?mode=validate, or a conversion such as ?mode=css-to-scss.

What the minifier removes and keeps

RemovedKept unchanged
Block comments (except /*! ... */ if you keep them)Selectors, specificity and rule order
Newlines, tabs and indentationProperty names, values and !important
Spaces around { } ; , > and after :Meaningful spaces in values: calc(100% - 32px), shorthands, grid-template-areas
The last ; before }Everything inside quoted strings, such as content: "a  b"
With shortening on: #ffffff → #fff, 0px → 0, 0.5 → .50% (it matters in keyframes and flex-basis)

It does not merge selectors, rewrite shorthands or drop unused rules; build-time tools such as cssnano and Lightning CSS go further because they parse the full grammar.

Worked example

/* card component */
.card {
  margin: 0 auto;
  width: calc(100% - 32px);
  color: #ffffff;
}

minifies to

.card{margin:0 auto;width:calc(100% - 32px);color:#fff}

Run Beautify on that line and the indented block comes back. The spaces inside calc() are kept because calc(100%-32px) is invalid CSS.

When to minify and when to keep CSS readable

Write and edit CSS in its readable form, and minify only the copy that ships to browsers. A minified file turns every change into an unreadable one-line diff. Most projects minify in a build step (Vite, webpack, a Sass compiler); for a static page, a WordPress theme, an HTML email <style> block or a CMS field with a size limit, pasting CSS here before uploading is a quick substitute. Beautify is the reverse job: reading a vendor or legacy stylesheet that arrived minified.

Converting between CSS, LESS, SCSS, SASS and Stylus

The convert modes are syntax swaps, not compilers. They change variable syntax (--x, @x, $x) and var() references, and add or remove braces and semicolons for the indentation-based Stylus. They do not resolve @import, expand mixins, flatten nesting or evaluate math. For those, use a real compiler or the SCSS to CSS, LESS to CSS, SASS to CSS and Stylus to CSS converters.

Common questions

Does minification break my CSS?

No. Only comments and insignificant whitespace are removed, and the optional shortening (#ffffff → #fff, 0px → 0) produces equivalent values. Strings and calc() expressions are left intact.

How much smaller will the file get?

Typically 15–40% before compression, depending on how many comments and how much indentation the source has. After gzip or Brotli the extra saving is smaller, because those already compress repeated whitespace.

How do I beautify or format minified CSS?

Paste it, choose Beautify, pick an indent size and click Run. Each rule gets its own block and each declaration its own line; nothing about how the CSS renders changes.

What does Validate check?

That every { has a matching }, and that strings and comments are closed, reporting the line of the first problem. It is a structural check, not a property validator; use the CSS validator for more.

Is this a real Sass or LESS compiler?

No. The convert modes swap syntax only and pass nesting, mixins and @import through. Use a dedicated compiler for a true build.

Is my CSS uploaded anywhere?

No. Everything runs in your browser, so unreleased stylesheets stay private.