9314JIUsi
Developer tools · CSS

CSS minifier & beautifier: one line or one tree

Minify strips comments and whitespace; beautify expands every block; @media nests right; comment switch; lenient semicolon warnings.

ATELIER Standard CSS · Lenient parser · 1MB cap
Mode
Indent
CSS input
Output (live)

CSS content is processed inside this device's browser only - nothing is uploaded, nothing is collected, and it works offline; mode, indent and comment preferences live in this browser's localStorage and are lost if you switch devices or clear site data. To remove them, use "Clear my data" in the footer.

Three steps, done

  1. PasteDrop your stylesheet into the left, or hit "Load sample" for a demo with @media, @keyframes and comments.
  2. PickMinify (strip comments and whitespace) or beautify (expand every block); @media rules indent one level deeper automatically.
  3. Verify & takeThe status line shows rule count and byte savings; a stable count across minify→beautify means nothing was lost.

Parameters and boundaries

InputStandard CSS (rules/declarations/@media/@supports/@keyframes/@import/comments); up to 1MB per run
OutputMinified (one line, whitespace stripped, comments optional) or beautified (each rule block expanded, declarations one per line, nested blocks indented progressively); lenient warnings (missing semicolons etc.)
Key parametersMinify mode and 2-space indent by default; ?mode=beautify&indent=4&comments=1 deep-links directly; minify strips comments by default (/*! */ survives), toggle keeps them all
ProcessingBrowser-local lenient parser (missing semicolons warn without blocking) - no uploads, no accounts; preferences in localStorage (nothing written on first load)
Limits1MB per run (rejected with a message beyond that)
Known limitsNo Sass/Less/Stylus variable or mixin syntax (those are preprocessors - compile to CSS first); no full CSS validity checking (structural issues only); no selector merging, no rule reordering

FAQ

Can it handle Sass / Less / Stylus?

No, and it will not pretend to. $variables, @mixin, nested selectors, .less mixins - that is preprocessor syntax; both browsers and this tool parse standard CSS, so those get treated as plain text or flagged with a warning. Compile your Sass to CSS first (a one-command sass file.scss job), then paste it here. This page's job is minifying and beautifying standard CSS.

Does minification remove my comments?

By default yes - that is the point of minification, and every byte counts. Two exceptions: /*! bang-prefixed important comments */ (the copyright-notice convention) survive by default, and a "keep comments" toggle preserves regular /* */ comments too when checked. Beautify mode keeps every comment by default, indented along with its rule.

What happens to rules with missing semicolons?

They warn, they do not block. Standard CSS allows the last declaration in a block to omit its semicolon (though appending another declaration later would break), so the tool warns which rule is missing one and processes the declaration anyway - more useful in practice than refusing. Minified output adds the semicolons back automatically, so later edits stay safe.

Is @media nesting indented correctly? Does the rule count change?

Yes. Rules inside @media (and block-level at-rules like @supports, @keyframes) indent one level deeper than the outer layer, and deeper nesting indents further - the hierarchy reads at a glance. The rule count does not change between minify and beautify: each selector-plus-declaration-block is one rule, and both modes count the same set. The status line shows rule count and byte savings so you can verify yourself.

Is my stylesheet uploaded anywhere?

No. Minification, beautification and checks all happen inside this device's browser - there is no upload endpoint and it works offline. Only preferences like indent width and the comment toggle live in this browser's localStorage; they do not follow you to another device, and "Clear my data" in the footer removes them.

Related tools