About CSS Formatter
Stylesheets grow by accretion: a rule added here, a vendor prefix there, and suddenly the file has three indentation styles and declarations in no particular order. This formatter parses the stylesheet with Prettier's PostCSS parser and prints it with consistent indentation, so selectors, at-rules and declarations are easy to scan and review.
Minify goes the other way: it removes comments, collapses whitespace and tightens punctuation while leaving strings, URLs and the spaces that value functions such as calc and custom properties need. Both modes run locally, both report parse errors with a line and column, and both refuse input over 10 MB.
What this tool does
Real CSS parser
Formatting uses Prettier's PostCSS parser, which understands at-rules, nested blocks, comments and declaration values instead of splitting on braces.
Two- or four-space indent
Choose the indentation used by the project; the formatted output follows it consistently for every rule and at-rule.
Minify that respects values
Minify removes comments and redundant whitespace while keeping strings, URLs and the spaces that calc and custom properties require.
Parser errors with position
When the stylesheet cannot be parsed, the message includes the line and column, so a missing brace or bad at-rule is quick to locate.
Copy and download
Copy the formatted or minified CSS or download it as a .css file, ready to paste into a project or a build step.
Runs in the browser
No upload and no server round trip: the stylesheet is parsed and printed by a plugin loaded into the page.
How to use CSS Formatter
- 01
Paste or load CSS
Paste the stylesheet into the input pane or load a .css file from your device, up to 10 MB.
- 02
Choose the indentation
Select two spaces or four spaces for the formatted output; minify ignores indentation and produces a compact result.
- 03
Format or minify
Press Format to pretty-print the stylesheet or Minify to remove comments and redundant whitespace. The CSS is parsed first and errors are reported.
- 04
Review the result
Check the output and the line count, and fix any parser error shown with its line and column before copying.
- 05
Copy or download
Copy the CSS to the clipboard or download it as a .css file, then run it through the project pipeline as usual.
Supported formats and limits
- Input
- CSS
- Output
- CSS
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Maximum size
- Bound by the memory available to your browser tab.
- Requirements
- Chrome, Edge, Firefox or Safari · JavaScript enabled
Limitations worth knowing
- Plain CSS only: SCSS, LESS and other preprocessor syntax are not supported.
- Minify removes comments, including licence headers; keep the original when those comments must ship.
- The PostCSS parser is permissive, so some invalid values are normalised rather than rejected; the output is not a CSS validator.
- Input is capped at 10 MB and formatting runs on the main thread after a short yield.
Privacy and file handling
Your CSS is read, parsed and printed entirely inside this browser tab with Prettier loaded as a page script. The stylesheet is never uploaded to FormatFlow or anyone else, no copy is stored and nothing leaves your device; closing the page clears the input and the result.
Read the full privacy policy
