Rates TodayNIFTY25,144.3+0.46%SENSEX81,592.5+0.70%Gold 24K ₹12,488.64/g down3.66Silver ₹156.28/g down0.05
InsightforGeeks

CSS Formatter & Minifier

Paste CSS to lay it out one declaration per line, or minify it to strip comments and whitespace and shorten values. Syntax problems are reported with the line and column. Everything runs in your browser, and your code is never uploaded.

0 bytes

How to use it

  1. Choose Format to make CSS readable, or Minify to make it smaller.
  2. Paste your CSS into the input box, or press “Load sample”.
  3. For Format, pick the indentation and an optional line length.
  4. Press the button, then copy the result or download it as a .css file.

Frequently asked questions

What does the CSS minifier do?

It removes comments and unnecessary whitespace and semicolons, and shortens values where this is safe, for example 0px to 0 and #ffffff to #fff. It keeps comments that start with /*! , which are normally licence notices. It does not reorder your rules, so the cascade stays the same.

Why is the minified file not smaller?

If the CSS is already minified, for example the output of a build tool, there is almost nothing left to remove. The tool says so when the result is not smaller.

What do the CSS problem messages mean?

They point to code the parser could not understand, such as a missing colon or an unclosed brace. The tool still formats the CSS, but you should fix the reported line, because browsers may ignore that rule.

Does it work with SCSS, Sass or Less?

No. It is for plain CSS. Nested SCSS rules and variables may be formatted incorrectly or reported as problems. Compile them to CSS first.

Is my code uploaded anywhere?

No. Everything runs in your browser.

Related tools

These tools run entirely in your browser and are provided free, without warranty. Check important results before using them in production.