CSS Minifier
Minify CSS — strip whitespace and comments, and shorten hex colours and zero units.
Input
Output
Ready
Drop a file to load it
About this tool
Compress a stylesheet to a single line, removing comments and shortening values where it is provably safe.
When you would use it
- Shrinking a stylesheet for production
- Inlining critical CSS into a page
- Reducing transfer size
Worked example
/* card */
.card {
color: #aabbcc;
margin: 0px;
padding: 0.5em;
}
.card{color:#abc;margin:0;padding:.5em}
Things worth knowing
- Six-digit hex colours are shortened to three digits only when the pairs repeat, so
#aabbccbecomes#abcbut#abcdefis left alone. - Zero values lose their unit (
0pxbecomes0) and leading zeros are dropped (0.5becomes.5). - Comments are removed, except
/*! … */licence comments, which are preserved by convention.
Questions
Frequently asked
How much will this save?
Typically 15–30% before compression. Once gzip or brotli is applied the saving is smaller, since whitespace compresses well — but minifying still helps.
Is it safe?
Yes. Only provably equivalent transformations are applied. Selectors, property names and values are never altered beyond the documented shortenings.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Related