CSS Formatter
Beautifies CSS with one declaration per line and consistent indentation.
Shrink CSS by removing comments, whitespace, and redundant characters. See the size before and after, including the gzipped size your visitors actually download.
.css file./*! ... */ notices you must keep.The minifier reads the CSS token by token, so strings, url() values, and comments are recognised before anything is removed.
/*! ... */ comments when you keep license comments.{, }, :, ;, ,, and >, and collapsed to one space elsewhere. Spaces around + and - inside calc() are kept, because CSS needs them.} is dropped, and empty rules are removed.#ffffff become #fff when all three pairs repeat.Input (123 bytes):
/* Buttons */
.btn {
color: #ffffff;
padding: 8px 16px;
width: calc(100% - 2rem);
}
.btn:hover {
color: #1f5fbf;
}Output (82 bytes, 33% smaller):
.btn{color:#fff;padding:8px 16px;width:calc(100% - 2rem)}.btn:hover{color:#1f5fbf}
Yes. Only characters that browsers ignore are removed, so the styles apply exactly as before. Keep the original file for editing.
Typically 15-30% for hand-written CSS with comments and indentation. After gzip the difference is smaller, because gzip already compresses repeated whitespace well.
By convention, a comment that starts with /*! holds a license or copyright notice that must stay in distributed files.
No. Minification runs in your browser.
Often used together with the CSS Minifier.
Beautifies CSS with one declaration per line and consistent indentation.
Minifies JavaScript with Terser and reports the size saving.
Beautifies HTML with consistent indentation, including inline CSS and JavaScript.