CSS Specificity Calculator
Work out how specific a CSS selector is, so you can tell which style rule wins.
1 Fill in the box
2 Your answer
Your answer shows here as you type.
How to use the CSS Specificity Calculator
- Type or paste your CSS selector.
- Read the first row. When two rules clash, the higher number wins.
Frequently asked questions
Which selector wins?
The one with more IDs wins. If IDs are equal, more classes, attributes and pseudo-classes win, then more element names.
Does an inline style count?
No. This tool only scores the selector. Inline styles and !important are not included.
Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.