DeveloperFree to use

Runs in your browser. No file uploads for processing. Privacy details

CSS Selector Specificity Comparer

Compare CSS selector specificity side by side, including :is(), :where(), :has() and selector lists, without applying styles to a page.

Loading tool...

How to compare two CSS selectors

  1. Paste selectors, not rules

    Enter the text before the opening brace, such as .card:where(#feature, .promo), in each field. An ordinary comma-separated list shows a separate score for each branch.

  2. Read the three counts

    Compare IDs first, then classes, attributes and pseudo-classes, then types and pseudo-elements. .card:where(#feature, .promo) is (0,1,0); article:is(.card, #feature) is (1,0,1) because :is() uses its strongest argument.

  3. Check the full cascade separately

    A higher score only helps when both selectors match the same target and the competing declarations have the same origin, importance and cascade layer. The tool does not apply either selector to your document.

Use cases

  • Explain an unexpected selector weight before rewriting a CSS override.
  • Compare a proposed :where() reset with a component rule.

Limits and privacy

  • Up to 3,000 characters and 80 selector branches per side. Enter standalone selectors; expand CSS nesting and do not include rule blocks or inline style declarations.
  • Uses current browser selector support to flag unsupported or invalid inputs. Does not determine matching elements, winner across selector lists, cascade layers, !important, animations, scopes or source order.

The tool processes inputs in your browser. File processing and site analytics are separate.

Frequently asked questions

Does this measure color contrast or accessibility?

No. Specificity only compares selector weights. Use the Color Contrast Checker to measure contrast between two actual colors.

Does :where() add specificity?

No. The pseudo-class and all of its arguments contribute zero, but the rest of the selector still counts.

How is :nth-child() with an of list scored?

It contributes one pseudo-class plus the specificity of the strongest selector in its of list. Without an of list, only the pseudo-class counts.

Which selector in a comma-separated list wins?

It depends on the selectors that actually match the target. The tool lists each branch rather than treating the strongest branch as the winner for every element.

Related tools