Need help with purgecss?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

6.5K Stars 229 Forks MIT License 1.1K Commits 84 Opened issues


Remove unused CSS

Services available


Need anything else?

Contributors list


npm npm GitHub Dependabot

PurgeCSS logo

What is PurgeCSS?

When you are building a website, chances are that you are using a css framework like Bootstrap, Materializecss, Foundation, etc... But you will only use a small set of the framework and a lot of unused css styles will be included.

This is where PurgeCSS comes into play. PurgeCSS analyzes your content and your css files. Then it matches the selectors used in your files with the one in your content files. It removes unused selectors from your css, resulting in smaller css files.

Sponsors 🥰


You can find the PurgeCSS documentation on this website.

Table of Contents




Getting Started


npm i --save-dev purgecss


import PurgeCSS from "purgecss";
const purgeCSSResults = await new PurgeCSS().purge({
  content: ["**/*.html"],
  css: ["**/*.css"],


This repository is a monorepo that we manage using Lerna. That means that we actually publish several packages to npm from the same codebase, including:

| Package | Version | Description | | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------ | | purgecss | npm | The core of PurgeCSS | | postcss-purgecss | npm (scoped) | PostCSS plugin for PurgeCSS | | purgecss-webpack-plugin | npm | Webpack plugin for PurgeCSS | | gulp-purgecss | npm | Gulp plugin for PurgeCSS | | grunt-purgecss | npm | Grunt plugin for PurgeCSS | | rollup-plugin-purgecss | npm | Rollup plugin for PurgeCSS | | purgecss-from-html | npm | Html extractor for PurgeCSS | | purgecss-from-pug | npm | Pug extractor for PurgeCSS | | purgecss-with-wordpress | npm | Collection of safelist items for WordPress | | vue-cli-plugin-purgecss | npm | Vue CLI Plugin for PurgeCSS |

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.