Developer Tools

CSS Minifier

Live

Reduce CSS file size by removing comments and unnecessary whitespace while preserving quoted strings and required separators.

About CSS Minifier

Reduce CSS file size by removing comments and unnecessary whitespace while preserving quoted strings and required separators. Enter css input, remove final declaration semicolons in a purpose-built workspace that keeps related controls together and makes units explicit. A quote-aware scanner removes block comments outside strings, collapses whitespace, and removes spacing around CSS punctuation without renaming selectors or rewriting values. The result panel reports minified css, original size in bytes, minified size in bytes, size reduction with copy-ready values and supporting context. The minifier is conservative but cannot prove semantic equivalence for every future CSS syntax. Test production styles after minification. Processing stays in your browser and the entered values are not sent to UtilityPages.

Set up CSS Minifier

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

Complete the fields to prepare a result.

Paste CSS to minify.

Turn remove final declaration semicolons on or off.

CSS Minifier results

Enter the values above, then minify css to see the result.

CSS Minifier method

A quote-aware scanner removes block comments outside strings, collapses whitespace, and removes spacing around CSS punctuation without renaming selectors or rewriting values.

How it works

A quote-aware scanner removes block comments outside strings, collapses whitespace, and removes spacing around CSS punctuation without renaming selectors or rewriting values. The minifier is conservative but cannot prove semantic equivalence for every future CSS syntax. Test production styles after minification.

Examples

CSS Minifier example

Example input
{
    "css": ".card {\n  color: #123456;\n  padding: 1rem 1.5rem;\n}",
    "remove_final_semicolon": true
}
Expected result
{
    "minified_css": ".card{color:#123456;padding:1rem 1.5rem}",
    "original_bytes": 51,
    "minified_bytes": 40,
    "savings_percent": 21.57
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Frequently asked questions

How does the CSS Minifier work?

A quote-aware scanner removes block comments outside strings, collapses whitespace, and removes spacing around CSS punctuation without renaming selectors or rewriting values.

What information should I enter in the CSS Minifier?

Enter css input, remove final declaration semicolons. Use values from the same scenario and keep measurement units consistent with the labels shown.

What results does the CSS Minifier provide?

The result workspace reports minified css, original size in bytes, minified size in bytes, size reduction. Supporting values are included so the primary result can be checked and interpreted.

How exact is the CSS Minifier?

The minifier is conservative but cannot prove semantic equivalence for every future CSS syntax. Test production styles after minification.