developerFree

CSS Minifier

Compress CSS for production use.

Free — no signupYour input stays on this device for this operation.Learn how to use CSS Minifier →
CSS Minifier illustration
ResultLive

01 Overview

About CSS Minifier

CSS Minifier compresses a stylesheet by removing whitespace, line breaks, indentation and comments, and shortening values where it is safe to do so — producing a much smaller file that browsers interpret identically, for faster first paints and less bandwidth. Minified CSS is not meant to be edited: keep your readable source, change that, and generate a fresh minified version for deployment. One caution: minifiers generally remove comments, so preserve any license notice separately if you must keep one. It runs entirely in your browser.

Adjust the options and review your result before downloading.
See our privacy policy for input handling and usage information.
Use a modern browser. Availability and performance depend on your device and the selected tool.

02 Workflow

How to use CSS Minifier

  1. 1
    Paste your stylesheetAdd complete, working CSS — minification preserves behaviour rather than fixing errors.
  2. 2
    Run the minifierUnnecessary whitespace, line breaks and comments are stripped locally on your device.
  3. 3
    Check and testConfirm the output is significantly smaller, then test the minified stylesheet in a browser to be sure the page still looks exactly right.
  4. 4
    Ship the compact CSSLink it from your production page or paste it where needed, and re-minify after any future edits to the source.

03 Good to know

Frequently Asked Questions

Will minified CSS style my page the same way?

Yes. Minification only removes characters that do not affect how browsers interpret the rules. Selectors, properties and values that define the design stay unchanged.

Does minifying remove all comments?

Minifiers generally remove comments because browsers do not need them. If a comment carries a license notice you must keep, preserve it separately in your source or documentation.

Should I minify CSS during development?

No. Keep CSS readable while you are building and debugging, and minify only for production or distribution, where size and speed matter most.

How much smaller does minified CSS get?

It depends on how the stylesheet was written. A generously spaced, heavily commented stylesheet shrinks noticeably, while CSS that is already compact shrinks very little. The saving is largest on stylesheets written for humans to read.

Does minifying CSS break media queries or animations?

No. Minification only removes whitespace, line breaks and comments, and shortens values where it is safe to do so. Selectors, media queries, animations and property values are preserved, so the page renders the same. Test the minified stylesheet in a browser before deploying it.

Can I minify CSS that uses custom properties?

Yes. Custom properties, also called CSS variables, are declarations like any other and are preserved as written. Minification does not rename or remove them, so the values they carry still apply exactly as before.

What should I do if minified CSS looks broken?

Compare it against the original in a browser. Minification preserves behaviour rather than fixing errors, so a problem in the minified output usually comes from an error already present in the source CSS. Fix the source, then minify a fresh copy.