Skip to content
AllToolsDesk

Popular

  • JSON Formatter & ValidatorFormat, minify and validate JSON with error locations.
  • CSS FormatterBeautify CSS, SCSS and Less with Prettier.
  • CSS MinifierCompress CSS and see the bytes saved.
  • JavaScript FormatterBeautify JavaScript and TypeScript.
  • JavaScript MinifierMinify JavaScript with Terser.
  • HTML FormatterIndent HTML, including inline CSS and JS.
  • Compress PDFShrink PDFs for email and upload limits.
  • Word to PDFConvert .docx documents to PDF.
67 free toolsSee all tools

CSS Minifier

Minify CSS to cut file size: removes whitespace and comments, shortens colours and values, and merges rules. Runs entirely in your browser.

  • Free
  • No sign-up
  • Runs in your browser
Ready.

About CSS Minifier

Every byte of CSS has to download and be parsed before a page can render, because browsers block rendering until stylesheets are ready. Minifying removes what browsers do not need: comments, indentation, line breaks and redundant characters.

Beyond removing whitespace, the minifier rewrites values in shorter equivalent forms, such as #ffffff to #fff and 0px to 0, and can merge rules that share a selector or declarations. The result behaves the same but is noticeably smaller, even before the server compresses it. Minify a copy for production and keep your readable source for editing; most build tools do the same as part of a release.

How to use CSS Minifier

  1. 1

    Paste your CSS, open a .css file, or load the sample. Pasting, opening a file or loading the sample runs it automatically.

  2. 2

    Leave “Merge rules” on for the smallest output, or turn it off to keep the original rule order.

  3. 3

    Turn on “Keep /*! */ comments” if your CSS includes a licence banner that must be preserved.

  4. 4

    Press Minify. The status bar shows how many bytes were saved.

Examples

Shorten values and drop comments
Input
/* button */
.btn {
  color: #ffffff;
  margin: 0px 0px 0px 0px;
}
Output
.btn{color:#fff;margin:0}

Good to know

  • “Merge rules” can reorder declarations. If your CSS relies on a specific cascade order across duplicate selectors, test the result or turn the option off.
  • Invalid CSS is passed through as-is rather than reported as an error.

Frequently asked questions

How much smaller will my CSS get?

It depends on the source. Hand-written, commented CSS often shrinks by 20–40%. Already-minified CSS will barely change.

Should I still use gzip or Brotli on my server?

Yes. Minification and compression work together: minify first, then let your server compress the file for transfer.

Is my code uploaded to a server?

No. Processing happens entirely in your browser, in a background thread. Your input is never sent to our servers or stored anywhere.

Browse all tools