CSS Specificity Calculator
Type one or more CSS selectors and instantly see their (a, b, c) specificity breakdown. Compare selectors side by side, ranked by weight, with visual bar charts for ID, class, and element counts.
CSS Selectors (one per line)
10 selectorsSpecificity Legend
ID selectors
#foo, #header
Class / attr / pseudo-class
.foo, [attr], :hover
Type / pseudo-element
div, p, ::before
Ranked by specificity
About !important
!important overrides specificity entirely — any declaration with it wins over all non-important declarations regardless of score. It is detected and flagged above but not factored into the numeric score.
How to use
Type your selectors
Enter one CSS selector per line in the textarea. Pre-loaded examples help you get started.
Read the (a,b,c) chips
Purple = ID selectors, Blue = class/attribute/pseudo-class, Green = type selectors and pseudo-elements.
Compare by rank
Results are ranked highest specificity first. The total score bar shows relative weight at a glance.
Copy the table
Use 'Copy table' to grab a formatted plain-text version of all results.