JSON Converters Code Gen Formatters All tools Browse all tools built byAbhay Darji

CSS Minifier

Minify CSS — strip whitespace and comments, and shorten hex colours and zero units.

100% client side No upload No size limit Works offline
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

CSS
/* card */
.card {
  color: #aabbcc;
  margin: 0px;
  padding: 0.5em;
}
Minified
.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 #aabbcc becomes #abc but #abcdef is left alone.
  • Zero values lose their unit (0px becomes 0) and leading zeros are dropped (0.5 becomes .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

Tools that pair well with this