Developer Tools

CSS Minifier

Minify CSS code by removing block comments, trimming whitespace, and stripping redundant semicolons to reduce stylesheet size.

Run tool

CSS Minifier is an online developer tool designed to compress stylesheet code by stripping out unnecessary characters while preserving core style rules. When you paste your stylesheet into the input field, the tool strips block comments, removes extra whitespace around braces, colons, semicolons, and commas, and collapses multiple consecutive spaces into single spaces. It also trims leading and trailing whitespace and removes any trailing semicolon right before a closing brace. After running the transformation, the interface displays the minified stylesheet alongside precise metrics, including the original character count, the minified character count, the total reduction in characters, and the savings percentage rounded to one decimal place. If you submit empty text or only spaces, the tool returns an empty output with zero size. This compact format helps reduce file transfer weight and speed up page load times across web projects.

Instructions

  1. Paste or type your CSS code into the CSS input area.
  2. Click the run button to compress the stylesheet text.
  3. Review the minified CSS output and the character savings metrics.
  4. Copy the compacted CSS text for use in your web application.

Examples

  • Input: /* Header layout */ header { color: #333333; margin: 0px 10px; } -> Output: header{color:#333333;margin:0px 10px}
  • Input: nav.main { display: flex; justify-content: space-between; } -> Output: nav.main{display:flex;justify-content:space-between}

FAQ

What types of comments does this tool remove?

The minifier removes standard CSS block comments placed between opening and closing comment delimiters.

What happens to the semicolon before a closing brace?

The tool removes the final semicolon located immediately before a closing brace to trim unnecessary characters.

How are blank or whitespace-only inputs handled?

Submitting empty text or input containing only whitespace characters yields an empty output with zero recorded size.

Embed this tool

Add this working SmartPlusLab tool to your website with the code below.