Skip to content

CSS Specificity Calculator

Calculate the specificity (A,B,C) of CSS selectors, including :is(), :not(), :has() and :where(), and see which wins.

Runs in your browserCSS selectors → Text
Loading tool…

Example

Input
#nav .item > a:hover
.btn.primary, ul li::before
:where(#x) p
Output
A,B,C   Selector
1,2,1   #nav .item > a:hover  ← highest
0,2,0   .btn.primary
0,0,3   ul li::before
0,0,1   :where(#x) p

How to use the CSS Specificity Calculator

  1. Paste or type your CSS selectors into the input area, or open a file from your device.
  2. Adjust the options above the editor if the tool offers any.
  3. Review the Text result, then copy it or download it as a file.

Privacy and limitations

  • Your data is processed on your device and is not uploaded to any server.

Frequently asked questions

How do I read A,B,C?

A counts IDs, B counts classes, attributes and pseudo-classes, C counts elements and pseudo-elements. Compare A first, then B, then C.

Browse all css tools →