Online CSS minification and formatting tool: compress by removing comments and whitespace, or format with proper layout. Protects string literals.
TL;DR: Free online CSS minifier that removes comments and whitespace, shortens color values, and optimizes shorthand properties. Significantly reduces CSS size, runs locally.
For local tools, open DevTools → Network and search your input — it should not appear in requests.
Next steps
Usage Guide
Minify CSS locally and compare byte size — a complement to, not a replacement for, build pipelines.
1. Minify
Paste CSS, compress, compare bytes, verify on a real page.
2. Fit
Handy for single files and emergencies; CI should still own production CSS.
3. What stays
License headers and unusual hacks may need manual care.
4. Colors/units
Hex shortening is usually safe; prefixing/compat is out of scope.
5. With other minifiers
Compress HTML/JS separately after features work.
6. Accept
Hard-refresh critical pages and diff if layout shifts.
FAQ
It strips comments and redundant whitespace, drops the last semicolon before each closing brace, shortens hex colors whose digit pairs repeat (#ffffff to #fff, #rrggbbaa to #rgba), and collapses zero values like 0px or 0em to 0 (percentages excluded). String literals and the inside of calc() are protected from mangling, and the page shows a before/after comparison in both characters and UTF-8 bytes.
No — minification is irreversible, so keep the original file. A code formatter can re-indent the output for readability, but comments and the original spacing are gone for good.
License banners (comments starting with /*!) are kept by default — verify that any legally required headers survived. Some sourceMappingURL comments and hack-style rules that depend on exact formatting need human judgment. The minifier only shrinks lexically; it does not understand what your styles mean.
It shines on single files, extracted style blocks, slimming CSS before inlining into email, and quick fixes. Large projects should rely on a bundler or cssnano in the build pipeline — this page is a touch-up tool, not a CI replacement.
Hard-refresh the key pages and watch the layout, especially pseudo-element content strings and spaces inside attribute selectors; if anything looks off, diff the output against the original. It also does not downgrade syntax for older browsers — that is autoprefixer's job, not this tool's.
No. The CSS stays in the browser from paste to output, and the minified result is never posted back to any backend.
Related Tools
Related Articles
Online CSS Minifier: Reduce CSS File Size for Better Performance
Learn how to minify CSS safely: whitespace, comments, hex shortening, zero-unit elision, calc protection, and UTF-8 byte savings — with an online tool you can use locally.
px, rem, em: What Each CSS Unit Actually Answers, and How to Convert Without Surprises
The boundary between px, rem, and em (root-relative vs parent-relative), the px-to-rem formula and size table, the 62.5% trick's hidden costs, the Safari media-query rem trap, and browser minimum font size — with an online converter.
Online CSS Gradient Generator: Create Beautiful Background Gradients
Build linear, radial, and conic CSS gradients visually—custom angle, stop positions, opacity, and one-click copy of the background rule—plus syntax, palettes, and accessibility notes.