Developer & Text Tools

CSS Minifier & Beautifier

Beautify CSS into readable, consistently indented rules, or minify it for production. Strings, comments, calc() expressions and nested @media blocks are handled correctly.
Runs in your browserLive result

Workspace

Options

Minify always keeps /*! licence */ comments.

How to use this tool

  1. 1Paste CSS, open a .css file or load the example.
  2. 2Choose Beautify or Minify and the indentation.
  3. 3Copy or download the result. The stats show how many bytes you saved.

Frequently asked questions

No. The minifier only removes whitespace and comments where the CSS grammar allows it. Spaces around + and - inside calc(), spaces before ( in media queries such as "and (min-width…)", and the contents of strings and url() are kept.

When beautifying you can keep or drop comments. Minifying removes ordinary comments but keeps /*! … */ licence comments, as most build tools do.

Plain nested blocks format correctly, so most SCSS indents well, but the tool is built for standard CSS. Sass-specific syntax such as @mixin with arguments is passed through unchanged rather than reformatted.

No. Everything runs in your browser with JavaScript. The text you paste is not uploaded, logged or stored by MuhammadLab.