CSS Minifier — Free Online Minify CSS Tool, Compressor & Beautifier

Free online CSS minifier: minify CSS safely (strings, url() and calc() stay intact), shorten hex colours, keep /*! license comments, or beautify minified CSS...

To minify CSS, paste your stylesheet or open a .css file; the minified CSS appears instantly with the bytes saved, ready to copy or download as a .min.css file.

Last updated:

CSS Minifier — Free Online Minify CSS Tool, Compressor & Beautifier. Free online CSS minifier: minify CSS safely (strings, url() and calc() stay intact), shorten hex colours, keep /*! license comments, or beautify minified CSS back to readable code.

Upload, copy or download — 100% in your browser. Our CSS minifier shrinks stylesheets in real time, right in your browser.

Paste your code or open a .css file and the tool will minify CSS by stripping comments, line breaks and indentation, collapsing whitespace, removing the last semicolon of each rule and shortening hex colours such as #FFCC00 to #fc0.

Unlike simple regex-based tools, this CSS compressor tokenises your stylesheet first, so quoted strings, content values, attribute selectors, unquoted url() paths and the spaces that calc() requires are never touched, and descendant selectors like .nav :hover keep their meaning.

A live size counter shows the original size, the minified size and exactly how many bytes and what percentage you saved.

CSS minification is one of the simplest ways to improve page speed: smaller stylesheets download and parse faster, which helps First Contentful Paint and Core Web Vitals, especially on mobile connections. Fine-tune the output with three options — keep /*!

… */ license comments (required by many open-source licenses), keep or drop the final semicolon, and turn colour shortening on or off. Need to read a compressed file instead?

Switch to Beautify mode to unminify CSS: this CSS beautifier re-indents rules with 2 spaces, 4 spaces or tabs, puts every selector and declaration on its own line and formats nested {'@'}media blocks, so you can debug a third-party .min.css in seconds.

Everything runs locally: your stylesheets are never uploaded, and the tool keeps working offline once loaded.

Load the sample to see the result instantly, copy the output with one click, download it as .min.css, or share a link that restores your CSS and settings. Optimising the rest of your front-end?

Compress markup with the HTML Minifier, shrink data with JSON Minify, XML Minifier and SQL Minifier, tidy templates with the HTML Formatter, or convert units with the PX to REM Converter.

Frequently asked questions

How do I minify CSS online?

Keep the mode on Minify and paste your code into Input CSS, or click Open .css file. The Minified CSS panel updates as you type, and the stats show the original size, output size and how much was saved. Click Copy, or Download to save it as a .min.css file.

What does the CSS minifier remove?

It removes comments, line breaks and unnecessary spaces, drops empty statements and, by default, the last semicolon in each block, and shortens hex colours such as #ffcc00 to #fc0. Strings, url() values and calc() expressions are kept intact. It does not merge, reorder or rewrite rules.

What do the minify options do?

Keep /*! license comments preserves comments that start with /*!, which are commonly used for license headers; all other comments are removed. Remove last semicolon drops the optional semicolon before a closing brace. Shorten hex colours rewrites six-digit colours to three digits when possible. All three are on by default.

Can I unminify or beautify minified CSS?

Yes. Switch the mode to Beautify and paste minified CSS; it is reformatted onto separate, indented lines. Choose 2 spaces, 4 spaces or Tab indentation, then copy or download the readable file. Regular comments are not kept when beautifying.

Is the minified CSS safe to use on my website?

The minifier only removes characters that browsers ignore, so the styles should behave the same. Test the result on your site and keep the original file for editing. Minification runs in your browser, so your CSS is not uploaded.

How to use this online tool

CSS Minifier — Free Online Minify CSS Tool, Compressor & Beautifier is designed for fast browser workflows when you need to format, validate, convert, decode, encode, generate, or inspect data without opening a heavy desktop app. Start with the input field or visible options, review the result, then copy or download the output for the next step.

Private processing in your browser

CSS Minifier — Free Online Minify CSS Tool, Compressor & Beautifier keeps the normal processing step local in your browser. That is useful for code snippets, tokens, documents, configuration values, text samples, and other material that should not be sent to a remote service unless you explicitly choose to share it.

When this tool is useful

Use CSS Minifier — Free Online Minify CSS Tool, Compressor & Beautifier for repeatable developer tasks, technical documentation, QA checks, quick conversions, debugging, content cleanup, and internal team workflows. The page focuses on clear inputs, immediate feedback, and output that is easy to reuse in code, reports, tickets, emails, or notes.

Practical tips

Before copying the final result, check important details such as spacing, casing, filenames, encoding, token structure, line breaks, or output format. Small checks prevent mistakes when the result is reused in source code, API requests, documentation, spreadsheets, or shared files.