CSS formatter

Make minified or messy CSS readable: one selector and one property per line, consistent spacing and nested media queries indented clearly.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Paste your CSSPaste the code, type it or open a file. Try Sample to see an example.
  2. Check the resultThe result appears on the right as you type. Errors are shown with the line and column.
  3. Copy or downloadCopy the CSS with one click or download it as a file.

Understand any stylesheet

Stylesheets copied from a live site are usually minified into a single line. Formatting splits them into rules you can scan quickly, with selector lists on separate lines and blank lines between rules.

Strings, url() values and data URIs are left exactly as they are, even when they contain braces or semicolons.

Choose 2 spaces, 4 spaces or tabs to match the style of your project before you paste the result back.

About CSS

CSS controls how pages look. Beautified CSS puts each rule and property on its own line; minified CSS removes everything a browser does not need while keeping values like calc(1px + 2px) intact.

Frequently asked questions

Are comments kept?

Yes, beautifying keeps all comments. Minifying removes them, except comments starting with /*! that usually hold license notes.

Is my code uploaded anywhere?

No. Formatting and minifying run in your browser. Your code is not sent to our servers.

Does minifying rename my variables?

No. Minifying removes comments, line breaks and spaces only. Names stay readable and the code behaves exactly the same, which makes it safe for any file.

Why are some line breaks kept in minified JavaScript?

JavaScript treats some line breaks as the end of a statement. Where removing one could change what the code does, it is kept.

Can I format JSON here?

JSON has its own tool with a tree view and validation. Use the JSON Tools page linked below.

Does it work offline?

Yes. After you open the page once, it keeps working without an internet connection.