What is css minifier?
CSS files often contain comments, indentation and blank lines that help people but are useless to browsers. Removing them reduces the file size and speeds up downloads.
This tool applies safe, simple minification in your browser. It is ideal for small files and quick fixes. For large builds, use a bundler or a build tool.
How to use the css minifier
- Paste your CSS.
- Press Minify.
- Copy the result and save it as a .min.css file.
How the css minifier works
Comments between slash star markers are removed. Whitespace is collapsed, spaces around braces, colons, semicolons and commas are dropped and the last semicolon before a closing brace is removed.
Worked example
Common uses of the css minifier
- Shrinking a stylesheet before launch.
- Making a small snippet fit in an email or widget.
- Reducing page weight to pass speed audits.
- Checking how much a stylesheet can be reduced.
- Preparing inline critical CSS.
Tips and common mistakes
Keep your original CSS. Minified files are hard to edit.
Always test the page after minifying. Rare edge cases, such as spaces inside content strings, may need a build tool.
Background: what to know before you rely on it
Page speed affects users and search rankings, and CSS blocks rendering, so the browser must download it before showing the page. Minification cuts bytes without changing meaning, and gzip or Brotli compression on the server cuts them again. Together they can shrink a stylesheet by 80 percent or more. Beyond minifying, remove unused rules, split large files by page and inline the small amount of CSS needed for the first screen. Modern build tools such as PostCSS and Lightning CSS do all this automatically, but a simple online minifier is handy for quick jobs.
Private, free and fast
This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all developer tools, or browse the full list of tools.
Frequently asked questions
Does minifying change how the page looks?
It should not. The rules are the same, only whitespace and comments are removed.
Is it safe for large files?
Yes for simple files. Use a build tool for complex ones.
Should I also compress with gzip?
Yes. Minify and compression work together.
Is my code uploaded?
No.
Related tools
HTML Minifier
Paste your HTML and the minifier removes comments and extra whitespace between tags to reduce file size...
Developer ToolsSVG Optimizer
Paste your SVG code and the optimizer strips comments, metadata and editor leftovers and rounds long...
Developer ToolsJSON Formatter and Validator
Paste your JSON and the tool checks that it is valid, then formats it with indentation or compresses it...
Image ToolsImage Compressor and Resizer
Choose an image, set a maximum width, quality and format, and download a smaller file. The image never...
Developer ToolsBase64 Encoder and Decoder
Base64 turns text or bytes into a safe string of letters and numbers. Choose encode or decode, paste...
Developer ToolsURL Encoder and Decoder
URL encoding replaces unsafe characters with a percent sign and two hex digits so a link works...
Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Do not paste live secrets into any website.