CSS Minifier/Beautifier
Compress or format CSS.
About CSS Minifier/Beautifier
CSS Minifier and Beautifier
Paste a stylesheet, choose "minify" or "beautify", and the tool parses the CSS and writes it back out in the format you picked.
Minify
Minifying removes comments, line breaks and extra spaces, and shortens some values. The browser applies the same styles, and the file downloads faster. On a 40 KB stylesheet you can often save a quarter or more before gzip or Brotli compression.
Beautify
Beautifying does the reverse. It puts each rule and declaration on its own line with 4-space indentation. Use it to read a minified file from a third-party theme or to clean up CSS someone wrote on one line.
Before You Paste
- Keep your source: minify a copy for production and keep the readable file in version control. Comments don't survive minification.
- Check newer syntax: the parser handles standard CSS well. Very new features, such as native nesting or some at-rules, may come out reformatted or dropped. Compare the output before you ship it.
- @import: the tool keeps
@importrules in the output but doesn't fetch or inline the imported files.
For Build Pipelines
This page works for one-off jobs. In a project, a build step such as Lightning CSS, cssnano (with PostCSS) or esbuild minifies on every deploy, so you never edit minified files by hand.