Code · Made a little simpler

CSS Specificity Visualizer

Inspect a CSS selector list or stylesheet with separate ID, class and type counts. Compare explicit declarations for a property among chosen matches and export the line-numbered scores locally.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

CSS Specificity Visualizer: how to use it

  1. Paste or open a UTF-8 stylesheet, or select Selector list and enter comma-separated selectors.
  2. Analyze specificity and read the ID, class and type counts for each selector. Nested and conditional rules display their source scope.
  3. For a stylesheet, enter a property and select the selectors that match your element. Copy or download the JSON report.

Limits and notes

Up to 120,000 UTF-16 code units and 2,000 selectors. The comparison covers explicit declarations in unscoped source rules with known matching selectors. Check shorthand and longhand interactions, invalid values, inline styles, layers and scope proximity in browser developer tools.

How your privacy works →

CSS Specificity Visualizer: common questions

Does an ID inside :where() count?

No. The pseudo-class and its arguments contribute zero. Simple selectors outside :where() still contribute their usual weights.

Which score applies to a comma-separated selector list?

Each selector gets its own score. A matching element uses the highest score among the branches it matches.

Can a lower-specificity selector win?

Yes. An important declaration takes precedence over a normal declaration in the same origin and layer. When importance and specificity tie, later source order decides under the same conditions.

Guides