Home › Developer Tools › CSS Formatter & Minifier
#

Free Online CSS Formatter & Minifier

Make minified CSS readable again, or shrink your stylesheet for production.

Your data stays on your device. This tool processes everything directly in your browser. Nothing you enter is sent to our servers.

Tip: Ctrl + Enter to format · Ctrl + K to clear

Output
Your CSS will appear here.

How it works

  1. Paste your CSS, minified or messy.
  2. Click Format for readable code, or Minify for the smallest file.
  3. Choose your indentation style if you are formatting.
  4. Copy the result or download it as styles.css / styles.min.css.

Frequently asked questions

What does a CSS minifier remove?

Comments, line breaks, indentation, spaces around braces and colons, and the last semicolon in each block. The styles behave exactly the same, but the file downloads faster. Comments starting with /*! (usually licences) are kept.

Is minified CSS safe to use in production?

Yes. Minification only removes characters the browser ignores. Spaces that matter — like the descendant space in "div p", "and (" in media queries and spaces around + and - inside calc() — are preserved.

Does it support media queries and CSS nesting?

Yes. @media, @supports, @font-face, @keyframes and native CSS nesting (& selectors) are formatted with the correct indentation.

Why do I see a "check your CSS" warning?

The tool noticed an unclosed brace, comment or string. It still formats what it can, but the stylesheet probably has a typo worth fixing.

Beautify or minify your stylesheets

Minified CSS from a website or framework is almost impossible to read. Formatting puts each selector and declaration on its own line with consistent indentation. When you are ready to publish, minifying strips everything the browser does not need so pages load faster.

What the formatter does

  • Places each selector in a list on its own line
  • Writes declarations as property: value; with one space after the colon
  • Indents rules inside @media, @supports and nested CSS
  • Keeps strings, url() values and comments exactly as written

What the minifier removes

Comments (except /*! … */ licence comments), line breaks, indentation, optional spaces and the final semicolon in each block. Minification typically shrinks hand-written CSS by 15–30% before gzip compression.

Safe by design

Some whitespace in CSS is meaningful. The minifier keeps the space in descendant selectors like div p, in media queries such as screen and (max-width: 600px), and around + and - inside calc(), so your styles behave exactly the same.

Keyboard shortcuts

/
Search all tools
?
Show this help
Esc
Close search or dialogs
Ctrl + Enter
Run the tool's main action (Format, Generate, Calculate…)
Ctrl + K
Clear the tool's input

Tool shortcuts work while you're using a tool, including inside its text boxes.