How to use CSS Specificity Calculator
- Enter supported selectors in source order.
- Inspect ID, class/attribute/pseudo-class and type contributions.
- Compare tuples under the stated matching and cascade assumptions.
Example: CSS Specificity Calculator
#main .item and div.item.
Options
- Selector branches
- Comma-separated branches are compared separately. Supported pseudo-selectors follow their documented specificity rules; unsupported syntax is refused.
- Ordered tuple
- Compare ID, class-like and type counts from left to right. Do not convert the tuple into a decimal score whose digits can carry into another column.
Supported inputs and limits
Where your input is processed
This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.
Specificity settles only one part of the cascade
The comparison assumes the selectors all match the same element under equal origin, layer, importance and other cascade conditions. A larger tuple alone cannot explain a rule from a different cascade layer or an !important declaration. Equal tuples can be decided by source order. Inspect the real matched rules in the browser when diagnosing a style conflict.
Questions about CSS Specificity Calculator
Does :where() add specificity?
No. Its contribution and those of its arguments are zero.
Why does an ID inside :is() count?
The functional pseudo-class uses the largest specificity among its supported selector arguments.
Does the largest tuple always win a real page?
No. Matching, importance, origins, cascade layers and other cascade rules must be resolved before a specificity comparison.