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

Published in: CSS - lists

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

(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.

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 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.

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

📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: CSS - lists

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube