Skip to content
CSS → Minified CSSDeveloper tools

CSS Minifier

Minify CSS in your browser: strip comments, line breaks and spaces around braces, colons and semicolons, and see how many bytes you saved.

About this tool

About CSS Minifier

This CSS minifier shrinks a stylesheet by removing everything the browser ignores. Paste your CSS and the minified version appears at once, with the original and new size in bytes and the percentage saved. It removes all /* … */ comments, joins the whole stylesheet onto one line, collapses runs of spaces, tabs and line breaks into nothing or a single space, removes the spaces around { } : ; and commas, and drops the last semicolon before each closing brace, which is allowed by the CSS rules. So “.button { color: #fff; padding: 8px 16px; }” becomes “.button{color:#fff;padding:8px 16px}”. Values with spaces that matter, such as margin: 0 auto or calc(100% - 2rem), keep the single spaces they need. On a well-commented, indented stylesheet this typically saves 15 to 35 percent before gzip. That is useful for inline style blocks in emails and landing pages, CSS pasted into a WordPress Customizer or theme field, small sites without a build step, and checking how much a stylesheet would shrink. It runs entirely in your browser, so your code is not uploaded. It is a whitespace-and-comment minifier: it does not merge duplicate rules, shorten colours (#ffffff to #fff) or remove unused selectors, which full build tools like cssnano or Lightning CSS do. Two cases need a quick check. A space before a colon in a selector is meaningful — “.menu :hover” means any hovered element inside .menu, while “.menu:hover” means the menu itself — and the minifier removes that space, so write such selectors as “.menu *:hover”. Spaces after commas or colons inside quoted strings, for example in content: “a: b”, are removed too. Keep an unminified copy as your source file and edit that, not the minified one.

CSS Minifier tool

When to minify CSS by hand

No build step needed

Email style blocks

Every byte counts toward Gmail’s clipping limit.

ExampleMinify the newsletter’s embedded CSS before sending.

WordPress Additional CSS

Customizer and theme fields hold pasted CSS.

ExamplePaste a minified copy, keep the readable one in your notes.

Small static sites

Hand-made sites often have no bundler.

ExampleMinify style.css before uploading by FTP.

Inline critical CSS

Critical CSS in the page head should be tiny.

ExampleMinify above-the-fold rules before inlining them.

Page-speed audits

Lighthouse flags unminified CSS.

ExampleCheck how much a flagged stylesheet would shrink.

Sharing snippets

Compact CSS for a widget or embed code.

ExampleMinify the style block of an embeddable badge.

CSS minifying tips

Small, and still correct

Selectors with “ :”

“.menu :hover” and “.menu:hover” mean different things, and the space is removed. Write “.menu *:hover” instead.

Keep the source

Edit your readable file and minify again. Never edit the minified copy.

Quoted text

Spaces after : , ; inside content: "…" strings are removed too. Check pseudo-element text after minifying.

Gzip still matters

Minify plus gzip or Brotli on the server gives the smallest download.

Minify the HTML too

Shrink the page markup as well.

Open HTML Minifier

Build nicer styles

Make gradients and shadows, then minify the CSS.

Open CSS Gradient Generator
Built & tested by

HemantInsights

Senior Software Engineer · Developer of Toolyconvert

Hemant developed CSS Minifier and tests it on desktop and mobile with real files. He is a senior software engineer from Dehradun, India, building websites since 2014, and designed and developed Toolyconvert end to end.

Last updated 24 November 2026

Answers and guidanceFrequently Asked Questions
What does the CSS minifier remove?
Comments, line breaks, indentation, extra spaces, the spaces around { } : ; and commas, and the last semicolon in each rule.
Will minified CSS work the same?
Yes for normal stylesheets. Check selectors that use a space before a colon (like “.menu :hover”) and quoted content strings, which can change.
Does it shorten colours or merge rules?
No. It removes comments and whitespace only. Build tools such as cssnano also shorten colours, merge rules and remove duplicates.
Does it break calc()?
No. Spaces around + and - in calc() are kept, because only spaces around braces, colons, semicolons and commas are removed.
How much smaller will my CSS be?
Typically 15 to 35 percent for commented, indented CSS. The exact bytes and percentage are shown.
Is my CSS uploaded?
No. Minifying runs in your browser.
Can I un-minify CSS?
You can re-indent it with a CSS formatter or your code editor’s format command, but removed comments are gone.
More tools for your workflowRelated Tools

HTML Minifier

Minify HTML in your browser: remove comments, line breaks and extra spaces between tags, and see the size saved. Copy the result in one click.

CSS Gradient Generator

Make linear, radial and conic gradients with up to ten colors. Copy CSS, Tailwind or SVG, or download the gradient as a PNG.

CSS Box Shadow Generator

Design CSS box shadows with up to six layers, presets (soft, layered, retro, glow, neumorphic), inset shadows and Tailwind output.

CSS Usage Analyzer

Paste a stylesheet for a full report: real minified and gzip size, specificity, !important, duplicate selectors and declarations, colours, fonts, breakpoints, and the selectors that match nothing on your page.

1 / 3
Browse all developer tools

Featured on

Toolyconvert is listed on these product directories and launch platforms.