Category: Developer tools

CSS Minifier

System ideaMissing a tool?

Remove comments and extra whitespace from a pasted stylesheet

Paste CSS, remove comments and extra whitespace locally, compare UTF-8 byte sizes and copy the compact one-line stylesheet.

Minified in your browser.

Result
.tool-card{display:grid;gap:12px;color:#123}.tool-card:hover{color:#00796b}
Original size121 BResult size75 B

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

This CSS minifier takes one pasted stylesheet and applies a fixed whitespace-and-comment pass. It removes every /* */ comment, collapses whitespace, removes spaces around braces, colons, semicolons and commas, and drops the final semicolon before a closing brace. Quoted strings are tokenized before minification, so punctuation inside a string is preserved. The page shows input and output size in UTF-8 bytes and includes sample, clear and copy actions. It does not beautify or un-minify CSS, validate syntax, preserve license comments, shorten colours, rewrite units, merge duplicate rules, remove unused selectors, process Sass/Less/Stylus, upload files, create downloads or estimate gzip or Brotli size. Invalid CSS is compacted as text rather than rejected. Your stylesheet stays in the browser and is not uploaded to LocalTools.

How to use it

  1. Paste a stylesheet into the input area, or load the sample.
  2. Let the local minifier remove comments and insignificant spacing while preserving strings.
  3. Compare UTF-8 byte sizes and copy the compact single-line CSS.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

Why minify CSS?
Minification removes comments, line breaks and spacing that browsers do not need, so the same stylesheet text becomes smaller and easier to ship.
Does minifying change how the stylesheet renders?
The tool keeps selectors, properties and values in place and preserves quoted strings. It does not perform rule-level optimization, so normal CSS behavior should stay the same.
Can I un-minify or beautify the CSS again?
No. This page only minifies pasted CSS. It has no beautify, un-minify, source-map or formatting mode.
How much smaller will the file be?
The page reports input and output sizes in UTF-8 bytes. It does not calculate a saved percentage and does not estimate gzip or Brotli compression.
Is my stylesheet uploaded to a server?
No. The tokenizer and minifier run in the browser, and LocalTools does not receive or store your CSS.