home / tools / css minifier

CSS Minifier.

Paste code, upload a .css file, or fetch a URL. Selectors get merged, declarations compacted, comments stripped, whitespace squeezed. Minification runs in your browser using CSSO, a structural CSS optimizer.

// minification powered by CSSO v5.0.5 · MIT license · original work by Sergey Kryzhanovsky, Roman Dvornov, and contributors
// how it works & attribution

Minification is handled by CSSO (CSS Optimizer), a structural CSS minifier originally built by Sergey Kryzhanovsky and maintained by Roman Dvornov. The library is loaded once from a public CDN (cdn.jsdelivr.net/npm/csso@5.0.5), then your code is minified entirely in this browser tab. Nothing is sent to any server.

Restructure goes beyond removing whitespace: it merges rules with identical selectors, drops declarations that are overridden later, and rewrites shorthands where it's safe. Big size wins, but it can occasionally reorder declarations in ways that break very fragile cascades. Turn it off if you suspect a regression.

Keep license comments preserves comments that start with /*!, the conventional marker for license/attribution blocks required by MIT, BSD, and similar OSS licenses. Disable to strip everything.

URL fetch limitations: browsers block cross-origin requests by default. The "Fetch" button only works for URLs served with permissive CORS headers (most public CDNs, including jsdelivr, unpkg, and cdnjs, allow this; most private hosts don't). If a fetch fails, paste the code instead or download the file and use Upload.

Privacy: your code never leaves your browser. Verify in the Network tab: you'll see the CSSO library download once on first use, and nothing else.

Attribution: this tool is a thin wrapper around CSSO (MIT). All minification credit belongs to the CSSO maintainers.

Related: need to minify JavaScript? The JavaScript Minifier does the same browser-local treatment for JS. Working with JSON? Try the JSON Formatter & Validator.

// a free, browser-only tool by Tiempo Software, built in Omaha, Nebraska. Runs entirely in your browser; nothing you enter is uploaded. see all tools.