Free tools, no sign-up — everything runs in your browser.
ToolHub 1000Free online tools

CSS Specificity Calculator

Enter a CSS selector and get its ID, class and element counts plus a total specificity score.

Quick answer: enter your details below and click Calculate specificity — your result appears instantly, right here in your browser. Nothing you enter is uploaded or stored.
C
Developer

Enter your details below.

How to use

  1. Enter a CSS selector.
  2. Click Calculate specificity.
  3. Compare the score with competing selectors: the higher score wins.

About this tool

Specificity decides which CSS rule wins when two rules target the same element. Paste a selector and this tool counts its IDs, its classes plus attributes plus pseudo-classes, and its elements plus pseudo-elements, then combines them into a score. The result is a practical approximation for common selectors, which is enough to settle most why-is-my-style-ignored questions.

Frequently asked questions

Why is an ID worth 100 and a class worth 10?

Specificity is usually written as three groups, and the score here turns those groups into one number for easy comparison: IDs times 100, plus the middle group times 10, plus the element group.

Is this score exact for every selector?

No. It is a practical approximation for common selectors. Unusual cases like :not() contents and nested rules can behave differently, so treat edge cases as estimates.

Related tools

All tools · Read the guide: CSS Specificity Calculator