Skip to content

CSS Formatter & Minifier

Format CSS into clean, readable code, or minify it to make it smaller. Free online CSS beautifier that runs in your browser.

Something not working? Report a problem

What is the CSS Formatter & Minifier?

Paste squashed CSS and get one rule per block with neat indents. It makes style sheets easy to read and compare.

Choose Minify to remove spaces, comments and the last semicolons, which shrinks the file for faster pages.

How to use it

  1. Paste your CSS in the left box.
  2. The clean version shows on the right.
  3. Copy it or save it as a file.

Why people like this tool

Prettier powered

The same formatter many teams use.

Fast and private

Runs in your browser, nothing is sent.

Shows the error

Tells you where the code is broken.

Your style

Choose indent size and line width.

When to format and when to minify

  • Format (beautify) when you need to read, fix or compare a style sheet. This is the right choice for CSS you copied from a live site or got from a tool that squashes everything onto one line.
  • Minify just before you publish. Spaces and comments are removed, so the file is smaller and the page can load a little faster.

Keep your readable copy as the file you edit. Do not edit the minified copy by hand.

Common mistakes this tool helps you spot

  • A missing closing brace }. The formatter stops and shows an error instead of guessing.
  • A missing semicolon between two rules.
  • A rule placed in the wrong block, which becomes easy to see once each block has its own indent.

Formatting only changes spaces and line breaks. The page will look the same before and after.

How it works, in one picture

Infographic: how to use the CSS Formatter & Minifier in 3 easy steps: Paste your code, Choose your options and Copy the result. You get: Prettier powered, Fast and private, Shows the error and Your style.

Frequently asked questions

How do I beautify CSS?
Paste your CSS in the left box. The right box shows it with one property on each line.
Will minified CSS work the same?
Yes. Minify only removes spaces and comments. Special comments that start with /*! are kept.
Does it work with media queries?
Yes. Media queries, keyframes and nested blocks are all formatted.
Does formatting CSS change how my page looks?
No. It only changes spaces, indents and line breaks. The browser reads the rules in the same order, so the result is the same.
Can I format SCSS or LESS here?
This tool is for plain CSS. For SCSS, use the SCSS Formatter tool on ToolPoint.

You may also like