CSS Formatter

Format CSS declarations, rules and media queries with consistent indentation.

Input

Processed on your device

How to use CSS Formatter

Turn compressed stylesheet text into readable CSS for reviewing selectors and declarations. Useful when checking an existing asset or updating a small rule.

  1. Paste CSS or choose a local file.
  2. Pick Indentation, format and review unfamiliar directives before replacing an asset.
Example input
.notes{padding:12px 16px;background:#faf5ef}.notes h1{font-size:28px}

Example use

Read a compact stylesheet to find the rule controlling a particular component’s padding.

Output and compatibility

Formatting changes textual layout, without adding a browser support matrix or automatically redesigning selectors. Parser support for language extensions depends on the bundled formatter.

Troubleshooting

If the file is SCSS or includes build-only expressions, compile or format it with tooling configured for that source dialect.

Try CSS Grid Generator if you need to create a layout declaration before formatting the stylesheet.

Frequently asked questions

Will it combine duplicated selectors?

This is a formatting workflow. Keep optimization and semantic edits separate.

Can I compact the result again?

Use CSS Minifier.

Find a tool