CSS Minifier
Minify CSS online with conservative comment, indentation, and safe punctuation cleanup while preserving strings, URLs, calc(), and protected comments.
Paste a CSS fragment or stylesheet and generate compact output for documentation examples, inline styles, theme snippets, or pre-publish review. Processing stays in your browser and no external resources are requested.
Browser-local processing
CSS Minifier
How to use
Finish in three steps
- 01
Paste a stylesheet, component CSS, inline style fragment, or documentation example into the input box.
- 02
Click “Minify CSS” to generate a conservative browser-local result.
- 03
Review calc(), custom properties, license comments, compatibility patterns, and the target build flow before copying the output.
What this CSS Minifier changes
The tool removes ordinary CSS comments, compacts line breaks and indentation, trims whitespace around safe declaration punctuation, and removes unnecessary semicolons before closing braces. It does not load resources, inspect pages, execute scripts, call build tools, or upload input.
Why the minifying is conservative
CSS strings, url(), calc(), attribute selectors, custom properties, and license comments can depend on specific tokens or spacing. Conservative minifying prioritizes valid CSS over aggressive byte shaving.
What to review after minifying
If your CSS includes PostCSS, Sass, Less, browser hacks, source map comments, license text, CSS variables, or complex functions, test the result in the target build and browser environment. This tool is not a complete build pipeline, compatibility audit, or performance conclusion.
FAQ
About this tool
Can CSS minifying change visual output?
Conservative minifying usually changes source layout only, but CSS functions, custom properties, comment conventions, and compatibility patterns still deserve review in the target page.
Are comments removed?
Ordinary /* ... */ comments are removed. Comments that start with /*! are preserved, which is often used for licenses or required project markers.
Does this replace my project build tool?
No. It is useful for browser-local snippet cleanup and manual review, not a replacement for PostCSS, CSS bundlers, autoprefixer, source maps, or production build workflows.
Does this tool upload my CSS?
No. The minifying step runs in the browser. You should still avoid pasting unpublished designs, internal URLs, customer data, or sensitive production paths into pages you do not trust.
Keep exploring
Related tools
Last updated: