Zero Signup ToolsFree browser tools

Developer Tools

CSS Formatter

Format and beautify minified or messy CSS in your browser. Indent, sort declarations, choose brace style, and copy the result. No signup.

CSS formatter and beautifier

Format options

Pick the indent, brace style, and property handling. Output updates as you type.

0 chars / 0 B

Indent

Brace style

Place the opening brace on the same line as the selector.

Property case

Keep the original case of property names.

Declaration order

Keep declarations in the order they appear in the source.

Comments

Preserve /* ... */ blocks in the output.

Blank lines between rules

Turn off for tighter output. On is closer to a manually-formatted stylesheet.

0 chars
Load sample

CSS is parsed and rendered entirely in your browser. The stylesheet you paste is never sent to a server.

Output

Paste minified or messy CSS to beautify. Output appears here automatically.

How to use

  1. Paste the minified or messy CSS into the input area on the left. You can also click a sample (Minified, Nested rules, Media queries, Keyframes, Custom properties, Imports and layers) to try the formatter quickly.
  2. Pick your indent (2 spaces, 4 spaces, or tab) and your brace style (same line keeps the opening brace next to the selector, new line uses Allman style).
  3. Choose how to handle property names and declaration order. Lowercase is recommended for consistency; Sort A to Z reorders declarations inside each rule without reordering nested rules.
  4. Decide whether to keep or strip comments, and whether to add a blank line between top-level rules.
  5. Read the formatted output on the right, check the rule and declaration counts, and click Copy output to grab the result. Use Replace with output to load the formatted CSS back into the input for another pass.

About this tool

CSS Formatter takes minified, single-line, or just messy CSS and returns a clean, indented stylesheet that is easy to read and review. The formatter ships its own tokenizer and parser instead of going through the browser CSSOM, so vendor prefixes, custom properties (--var), modern at-rules (@layer, @container, @supports), nested rules with & selectors, @keyframes, vendor pseudo-classes, and unknown declarations all survive the round trip intact. You can pick the indent character (2 spaces, 4 spaces, or a tab), the brace style (same line or Allman new line), whether to lowercase property names, whether to preserve declaration order or sort each rule alphabetically A to Z, and whether to keep or strip /* ... */ comments. A blank-line toggle adds or removes the breathing room between sibling blocks. Long selector lists are split onto one selector per line so they stay scannable, and url() literals, content strings, and CSS functions are passed through untouched. The tool reports rule, declaration, at-block, comment, and max nesting depth counts as a sanity check, and any unclosed strings, missing semicolons, or other recoverable parse issues are surfaced inline so you can fix the source. Everything runs locally in your browser, so the stylesheets you paste here, including production CSS exported from build pipelines, never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools