Skip to main content
kitlocal.dev

CSS Specificity Calculator

Runs locally

100% processed in your browser. Inputs and outputs never leave your device.

Calculate and compare CSS selector specificity values

Specificity Rankings
Highest(A, B, C)
#main-nav ul li a:hover
1
1
3
ID selector present
.container > p.highlight
0
2
1
body main section[data-theme="dark"]
0
1
3
div
0
0
1

Scoring Ruleset

Bucket A — IDsMatches #id selectors
Bucket B — Classes & AttributesMatches .class, [attr], and :hover pseudo-classes
Bucket C — Type & Pseudo-elementsMatches element tags (div, p) and ::before / ::after
Inline styles and !important override author stylesheet specificity.