CSS Formatter & Minifier
Copied!
Input: 0 chars
Output: 0 chars
Saved: 0%
A browser-based CSS tool that can beautify messy CSS with proper indentation, or minify it for production by stripping comments, whitespace, and unnecessary characters. Shows real-time size savings.
Why Use This CSS Formatter?
- Format or Minify — two modes in one tool.
- Comment stripping — minifier removes all CSS comments automatically.
- Size stats — see input/output sizes and percentage saved at a glance.
- No dependencies — runs entirely in your browser.
Key Features
- Smart Indentation: Indentation tracks
{/}nesting depth with 2-space tabs. - Property Splitting: Each declaration gets its own line after
;. - Comment Removal: Minifier strips all
/* */block comments. - Whitespace Compression: Collapses multi-spaces and removes spaces around
{};:,.
How it Works
The formatter walks the CSS character by character: { increases indent and starts a new line, } decreases indent, and ; triggers a line break. The minifier uses regex to strip comments, collapse whitespace, and remove spaces around structural characters.
Try the CSS Formatter
Paste your CSS, click “Format” or “Minify”, then copy the result.