CSS Specificity Calculator

Calculate and compare CSS selector specificity scores

Share this tool

Report a problem

Describe the problem without including private input or files.

How useful was this tool?

How useful was this tool?

Input & options

Quick presets & examples

Your inputs are never uploaded or stored.

Results

Enter your values to see the result.

About the Free CSS Specificity Calculator

The CSS Specificity Calculator is a free tool that helps web developers understand, calculate, and debug CSS selector specificity. Specificity is the algorithm browsers use to determine which CSS rule takes precedence when multiple rules target the same element. It is expressed as a three-part value (a, b, c), where each component represents a different category of selector weight.

Understanding CSS specificity is one of the most important skills for front-end developers. When styles are not being applied as expected, specificity conflicts are often the root cause. This calculator instantly breaks down any CSS selector into its specificity components, showing you exactly how many ID selectors (a), class/attribute/pseudo-class selectors (b), and element/pseudo-element selectors (c) contribute to the final score.

The tool includes a powerful compare mode that lets you place two selectors side by side to see which one wins in a specificity battle. This is invaluable when debugging CSS conflicts, refactoring stylesheets, or learning how the cascade works. Visual bar charts and color-coded breakdowns make specificity intuitive and easy to understand, even for developers new to CSS.