CSS Tools That Compress & Strip Unused Styles From Your CSS Files

People who are not web designers can compress CSS files in three easy ways:

css-tools(a) Strip whitespaces like spaces, tabs, etc.
(b) Remove all unused CSS classes & IDs
(c) Use shorthand mode (use #CCC instead of #CCCCCC, replace 1.0em with 1em, etc)

Now all these are very minor changes but quickly add up and may make your CSS file lighter by a few kilobytes. This translates to faster web pages as smaller files take relatively less time to download.

And fortunately, there are plenty of CSS tools available online that can do all this for you - they will analyze your CSS files, remove unwanted stuff and thus reduce the overall size.

optimize-css

Clean CSS - This tool pulls the CSS code from your website and optimizes it by removing comments, compressing the color codes and converting to shorthand mode CSS. It also outputs a detailed log so you know exactly what has changed in the background.

The tool offers various levels of compression depending upon how readable you want the code to be for humans.

css-styles

CSS Checker - This is probably the most useful CSS tool as it helps you find orphaned CSS styles (Classes, IDs, etc) that are present in the stylesheet but not used in the web pages.

You type the URL of your CSS file  and a list of web pages that use that particular styles. CSS Checker will then quickly figure out all the unused styles that you may safely discard or move to another CSS file. Thanks Divya.

css-beautify

CSS Compressor - This is pretty much like Clean CSS though you have more control over handling of comments and new lines in the optimized version of the CSS.

Unlike Clean CSS, the CSS Compressor tool can’t pull your CSS files - you need to copy-paste the CSS code in the text area.

Related: How to Completely Test Your Website

Find this article at: http://www.labnol.org/internet/design/css-tools-strip-unused-styles-compress/3879/

web: http://www.labnol.org/ email: amit@labnol.org


Reader Comments

Great tools for CSS noobs like me.
Thanks for sharing :)

i tried to compress my css sheet. Clean CSS (28.7%) looks better than CSS Drive compressor (20%). Good thing about Clean CSS is it tells you the kind of compression it did…

If you have a question or suggestion that is not related to the above discussion, please post it in this forum. All comments are moderated.

Add a Comment

required, use real name
required, will not be published
optional, your blog address
Google Custom Search