Search tools

Find a tool by name or what it does.

CSS Minifier

Strip comments and whitespace from CSS to shrink it, or beautify a minified stylesheet back into readable rules, with a size saved readout.

Minified live as you type. Styles never leave your browser.

Output

How to minify CSS online

  1. Paste your CSS

    Drop a stylesheet or a fragment into the input and the minified version appears immediately below.

  2. Check the savings

    The size before and after and the percentage saved are shown, or flip the toggle to beautify the CSS instead.

  3. Copy the result

    Use Copy CSS to grab the minified or beautified stylesheet and paste it wherever you need it.

Why use this tool

Strip comments and whitespace

Removes comments, indentation, and the whitespace between selectors and declarations, then collapses each rule onto a single line.

Size saved readout

Shows the size before and after minifying plus the percentage saved, so you can see exactly what the smaller file is worth.

Honest minification

Values are never rewritten, colors are never shortened, and rules are never merged. Strings, url() values, and /*! license comments are preserved.

Beautify toggle

Switch to pretty printing for one declaration per line with 2 space, 4 space, or tab indentation, turning a minified file back into readable rules.

Lenient with broken input

A missing brace or a stray character is processed best effort instead of rejected, so a small typo does not stop you from shrinking the rest.

Runs entirely in your browser

Everything happens on your device. Selectors, colors, and the rest of your stylesheet are never uploaded.

About this tool

This CSS minifier strips the parts of a stylesheet that only exist for humans: comments, indentation, line breaks, and the runs of whitespace between selectors and declarations. It also drops the semicolon before a closing brace and collapses each rule onto a single line, then reports the size before and after with the percentage saved. Paste a stylesheet and the smaller version appears instantly, so shrinking a snippet is paste, glance at the savings, copy.

The minification is deliberately honest. Strings, url() values, and comments that begin with /*! are preserved exactly, and values are never rewritten, colors are never shortened, and separate rules are never merged. The result is your CSS with the padding removed, not a different stylesheet that happens to look similar. For build-grade compression that rewrites values, the minifier in your bundler goes further; this one is for quickly shrinking a fragment or seeing what whitespace alone costs.

Flip the toggle to beautify and the same input is pretty printed instead: one declaration per line, consistent 2 space, 4 space, or tab indentation, and clean brace nesting, which is the fastest way to make a minified file readable again. Everything runs in your browser, so client stylesheets and unreleased styles never leave your device. For other formats, the JSON minifier does the same job for its own syntax, and the CSS beautifier covers the same ground when reading is your main goal.

Frequently asked questions

What does minifying actually remove?
Comments, indentation, line breaks, and whitespace between tokens, plus the semicolon before a closing brace. Each rule is collapsed onto one line. Values are never rewritten, colors are never shortened, and rules are never merged, so the output is your CSS with the padding removed.
Will minifying break my CSS?
No. Strings, url() values, and /*! license comments are preserved exactly, and only redundant whitespace and semicolons are dropped. The output is functionally the same as the input, just smaller.
Can I beautify or unminify CSS too?
Yes. Flip the toggle to beautify and the same input is pretty printed with one declaration per line and your choice of 2 space, 4 space, or tab indentation, which is the quickest way to make a minified stylesheet readable.
Is my CSS uploaded anywhere?
No. Everything runs in your browser and the stylesheet never leaves your device, which matters when the CSS belongs to a client project or an unreleased product.
Is there a limit on file size?
No fixed limit. Processing happens in your browser tab, so large files are bounded by your device memory rather than an upload cap, and the output area scrolls instead of stretching the page.

Related tools