← All tools

CSS Specificity Calculator

Compute the CSS specificity of one or more selectors and rank them. Enter a selector (or a comma-separated selector list) and each one is scored as (a, b, c) — IDs, classes/attributes/pseudo-classes, and elements/pseudo-elements — with the winning selector highlighted. Handles :is(), :not(), :has(), :where() (zero), ::pseudo-elements, and the legacy single-colon pseudo-elements. Everything runs in your browser; nothing is uploaded.

Tip: compare several at once with commas — #id, .class, div, * — to see which wins. Combinators (>, +, ~, descendant space) and the universal selector * add nothing.