WHAT IT DOES
Format CSS without breaking the values inside it.
Format modern CSS with a real bundled parser, then optionally produce a compact version. Comments, strings, data URLs, custom properties, nesting, layers, media queries, and calc expressions are parsed as CSS rather than rearranged by a whitespace-only regular expression.
Why use it?
Use it to make a stylesheet readable or compact without confusing whitespace removal with redesigning or validating its appearance.
How to use this tool
- Paste CSS, choose indentation, and format it.
- Use Minify if you need compact source, then check the result in your target browsers.
- For example, inspect a calc() declaration after rewriting. The tool does not fetch imported stylesheets, test selectors against your page, or produce a browser-compatibility report.
Details and limitations
- Prettier's CSS parser is bundled locally and reports syntax errors before output is written.
- Formatting keeps comments, quoted strings, URLs, custom property values, and modern at-rules in the CSS grammar.
- Minify removes formatting-only whitespace and ordinary comments with a stateful scanner after parsing; it does not rewrite declarations or values.
- Indentation can be selected as two spaces, four spaces, or tabs.