Updated
CSS specificity calculator explained
Calculate selector specificity with separate ID, class and type columns. The argument of :where() contributes zero; :is(), :not() and :has() use the largest argument score. The of-selector in :nth-child() contributes in addition to the pseudo-class.
A worked example
#a .b p has specificity [1, 1, 1]. :where(#a) p has [0, 0, 1], even though its argument contains an ID.
Before you use the result
This compares selector syntax, not the winning declaration on a live page. Nested & selectors need their parent context. Unknown functional selector rules are rejected rather than assigned a guessed score.
Cite this page
ToolOctopus. “CSS specificity calculator.” Updated 2026-09-20. https://tooloctopus.com/css-specificity.
Add an access date if your instructions require one.
Citation formatting uses citeproc-js by Frank Bennett and Citation Style Language styles. Licence and source code.
