CSS Formatter
Format CSS with consistent indentation or minify it by stripping whitespace and comments.
How to use this tool
- 1Paste CSS into the left 'Input CSS' panel.
- 2Click Format to pretty-print with 2-space indentation, or Minify to compact it.
- 3Copy the result from the right Output panel.
About CSS Formatter
CSS copied from a minified stylesheet or generated by a build tool is a single unreadable line. This formatter applies a regex-based beautification: opening braces get a space before them and a newline after, each property is indented with 2 spaces and followed by a newline, and closing braces get their own line with a blank line after. Minify strips all CSS comments (/* ... */), collapses whitespace runs to a single space, and removes spaces around {, }, :, ;, ,, >, ~, and + characters. The output appears in a side-by-side panel with a Copy button. Front-end developers cleaning up vendor CSS, designers inspecting minified stylesheets, and anyone who needs to read or edit a compressed CSS file are the primary users. Runs entirely in your browser.