HTML Formatter
Beautify and indent HTML markup.
OpenSqueeze a readable stylesheet down to one compact line for production or inline use.
Add readable CSS or drop a .css file onto the input.
Comments, line breaks and spaces around punctuation are removed.
Restore spaces around + inside calc() if your CSS uses it.
Copy the compact CSS or download min.css.
You need to inline critical CSS into the head of a landing page, or paste styles into a platform that limits field length. Minifying the stylesheet first keeps the payload small and the markup tidy.
The minifier removes /* */ comments, collapses all whitespace, deletes spaces around { } : ; , > ~ and +, and drops the semicolon before each closing brace. Property values, colors and units are not rewritten, so #ffffff stays #ffffff. Results appear as you type, and the output can be copied or downloaded as min.css.
Watch for two edge cases caused by the space-stripping rule. Inside calc(), the + operator must have spaces around it, and the minifier removes them, so calc(100% + 2rem) becomes invalid; restore those spaces by hand (the minus operator is left alone). Second, a descendant selector such as .menu :hover loses its space and turns into .menu:hover, which targets a different element. If something renders differently, expand the output with the CSS Formatter and compare. Markup with style blocks can be compacted in the HTML minifier too.
The stylesheet is compressed locally with string replacements, so proprietary theme code is not shared with anyone.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
No. It only removes whitespace, comments and redundant semicolons. Structural optimizations such as merging selectors or turning #ffffff into #fff are left to build tools.
CSS requires whitespace around + and - inside calc(). The minifier strips spaces around +, which makes the expression invalid. Add the spaces back around + in the output, or keep calc() rules out of the minified block.
Mostly. Whitespace inside quoted strings is collapsed like everywhere else, so a content value with double spaces ends up with one. URLs without spaces are unaffected.