CSS Beautifier & Minifier

Format compressed CSS with clean indentation for nested @media and @supports rules, or minify stylesheets while keeping calc() spacing, strings, and url() paths intact.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
CSS input
0 lines · 0 charsCSS3
Formatted CSS
0 B

About This Tool

Formats minified CSS stylesheets into indented rulesets (including nested @media, @supports, @container, and @keyframes blocks), or minifies CSS by stripping comments, whitespace, redundant semicolons, and zero units.

Unlike naive regex replacers, this parser protects spaces around + and - inside calc(), clamp(), min(), and max() so CSS math functions never break.

Key Features

  • Safe calc() & clamp() handling: Preserves required whitespace around + and - operators inside CSS math functions during both minification and formatting.
  • Nested at-rule indentation: Indents @media, @supports, @container, and @keyframes blocks to arbitrary nesting depth.
  • Zero-unit & hex shorthand optimization: Collapses 0px/0rem/0em to 0 and shortens 6-digit hex colors (#ffffff to #fff) when minifying.
  • String & url() protection: Leaves quoted strings and url(...) arguments untouched even if they contain colons, braces, or spaces.

Frequently Asked Questions

Why must spaces around + and - inside calc() be preserved?
Per the CSS Values and Units specification, calc(100%-24px) is parsed as a percentage token followed by a negative length rather than subtraction. Keeping spaces around + and - ensures browsers evaluate the expression properly.
What happens to /*! ... */ license comments when minifying?
Comments starting with /*! are kept by default so attribution headers survive minification. Uncheck the option in the toolbar to strip all comments.
Is my CSS stylesheet sent to a server?
No. All CSS formatting and minification runs locally in your browser.