Developer tools

CSS specificity calculator

Compare the specificity of two CSS selectors as (a, b, c) and see which one wins. :is(), :not(), :has() and :where() are counted too.

Runs in your browser. Nothing you enter is uploaded.

About this tool

The CSS specificity calculator compares two selectors and shows each one’s specificity as (a, b, c): IDs, then classes, attributes and pseudo-classes, then types and pseudo-elements. :is(), :not() and :has() count their most specific argument, :where() counts as zero, and a selector list takes its highest item.

What happens if the specificity is equal?
The tool shows a tie. In CSS the rule that comes later in the source then wins, unless cascade layers or !important change the order.
Is the "of S" part of :nth-child() counted?
No. :nth-child() always adds one to the middle column here, and the selector after "of" is ignored.