CSS Minifier
Compress your CSS by removing whitespace, comments, and unnecessary characters instantly.
Minified output will appear here...About CSS Minifier
CSS Minifier is a free online tool that compresses CSS stylesheets by removing every character the browser does not need: whitespace, line breaks, developer comments, and the trailing semicolons before closing braces. The resulting single-line output is byte-for-byte equivalent to the original — the browser applies every selector, property, and value identically — but the file is significantly smaller.
The tool is designed for the moment just before deployment. You write and maintain readable, well-commented CSS during development, then run it through the minifier once to produce the production file. It also accepts .css file uploads, displays the exact byte savings as a percentage, and lets you download the output as a ready-to-use minified.css file. Unlike a CSS formatter, which adds whitespace and indentation to make code easier to read, this tool does the opposite: it strips those characters to make the file faster to transfer.
All minification runs entirely inside your browser — your stylesheet is never uploaded to a server, sent to an API, or stored anywhere. This means you can safely minify proprietary theme files, client stylesheets, or internal design-system code without any data leaving your machine. The tool is free to use with no account required and no limit on file size or number of runs.
Key Features
Comment stripping with a toggle
A checkbox lets you keep or remove /* */ comments independently. Useful when you need to preserve licence headers or source-map annotations in the output.
Real-time byte-savings counter
After minification the tool shows original size, minified size, and the percentage saved so you can confirm the optimisation before deploying.
File upload and download
Upload a .css or .txt file directly from disk and download the minified result as minified.css, skipping the clipboard entirely for large stylesheets.
Trailing-semicolon removal
The last semicolon in each declaration block is redundant by spec and is removed, shaving extra characters from every rule.
100% client-side processing
Minification runs in your browser using plain JavaScript. Nothing is sent to any server, so private or proprietary stylesheets stay on your own machine.
Handles media queries and complex selectors
Spaces around combinators like >, ~, and + and inside @media rules are collapsed correctly, keeping complex selector logic intact.
How to Use
Paste Your CSS
Copy your CSS stylesheet and paste it into the input editor on the left.
Minify
Toggle the comment removal option if needed, then click "Minify" to compress your CSS.
Copy the Result
Review the size savings, then copy the minified CSS or download it as a .css file.
Example
Comments, whitespace, and the trailing semicolon before each closing brace are removed. Selectors, properties, and values are preserved exactly.
/* Button styles */
.btn {
display: inline-flex;
align-items: center;
padding: 10px 20px;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
}
.btn--primary {
background-color: #7c3bed;
color: white;
} .btn{display:inline-flex;align-items:center;padding:10px 20px;border-radius:8px;font-weight:600;cursor:pointer}.btn--primary{background-color:#7c3bed;color:white} Common Use Cases
- arrow_circle_right
Production deployment of hand-written stylesheets
You write a custom stylesheet with full indentation and comments during development, then minify it once before committing the production file. The minified version loads faster and reduces bandwidth costs, especially on high-traffic pages.
- arrow_circle_right
Reducing CSS bundle size without a build tool
Small projects, static sites, and email templates often do not have Webpack, Vite, or PostCSS configured. This tool provides one-click minification without any build-tool setup or npm install.
- arrow_circle_right
Auditing third-party CSS for size bloat
Paste a vendor or framework stylesheet to see how much of its weight comes from whitespace and comments. The byte-savings counter tells you immediately whether minification is already applied or if there is room to reduce payload.
- arrow_circle_right
Preparing inline styles for CMS or email templates
Email clients and some CMSs require CSS to be inlined or compressed into a single line. Minify a block of CSS rules before pasting it into a style attribute or template variable where newlines would break the syntax.
- arrow_circle_right
Comparing before and after a CSS refactor
Minify both the old and new stylesheet and compare character counts to verify that a refactor genuinely reduced code — not just reordered lines — before shipping.