Four-part score
Counts are compared left to right: inline, then ID, then class/attribute/pseudo-class, then type/pseudo-element.
Paste any CSS selector to see its specificity broken down into inline, ID, class and type weights, or compare two selectors to see which one wins.
🔒 Selectors are parsed locally and never uploaded.
Specificity decides which CSS rule wins when several rules target the same element. It is expressed as four numbers: inline styles beat any number of ID selectors, ID selectors beat any number of classes, and classes beat any number of type selectors.
Counts are compared left to right: inline, then ID, then class/attribute/pseudo-class, then type/pseudo-element.
Descendant, child (>), sibling (+, ~) combinators and the universal selector (*) add no weight.
Use the comparison panel to see exactly which of two competing selectors will win.
Specificity is a four-part score: inline styles, ID selectors, class/attribute/pseudo-class selectors, and type/pseudo-element selectors. Higher categories always outweigh any number of lower ones.
No. The universal selector (*) and combinators like >, +, ~ and space add no specificity weight.
The negation and matches-any pseudo-classes count zero on their own, but the specificity of their most specific argument selector is added.
No. The selector is parsed entirely in your browser and never sent to a server.