About the CSS Specificity Calculator
Paste a selector to see why one rule wins over another.
When two CSS rules conflict, specificity (a,b,c) for IDs, classes/attributes/pseudo-classes, and types/pseudo-elements helps explain the winner — aside from !important and order.
Paste a selector for a simplified count. Complex selectors with :is() or nesting may need MDN-level nuance beyond this helper.
When scores tie, teach source order and cascade layers next.
#id counts toward a, .class and [attr] toward b, and element names toward c in the simplified tally.
Attribute selectors and classes share the b column in classic teaching counts.
When (a,b,c) ties, teach source order and layers as the next lesson.
Quality habit for CSS Specificity Calculator: re-read labels once, then export. Share methods via the FAQ links rather than cropped images. Rotate the device for canvas-heavy layouts.
How to use the CSS Specificity Calculator
- 1Paste a selector.
- 2Read a,b,c.
- 3Compare with another.
Key features
- a,b,c counts.
- Selector paste.
- Teaching notes.
- Local.
Practical uses
- Debugging cascades.
- CSS workshops.
Tips and common mistakes
- Compare two selectors side by side mentally.
- Remember !important is separate.
- Read the on-page disclaimer before treating a figure as authoritative.
Limitations
- Simplified parser.
- Inline styles not scored as a,b,c.
- Not a full browser engine.
Privacy
Your entries on the css-specificity-calculator page never leave this browser for uTooli servers.
Frequently asked questions
Inline?
Inline styles are a higher layer than a,b,c.
!important?
Separate from specificity.
:is()?
Simplified counting — complex selectors may need MDN.
Uploads?
No.
Does order matter?
Yes after equal specificity. See the on-page notes for css specificity calculator limits.
!important?
Overrides specificity layers carefully. See the on-page notes for css specificity calculator limits.