Calculate CSS selector specificity — visual (a, b, c) breakdown with compare mode and selector explanation
ul li, .class, #id, .class1.class2, or complex selectors like div#id.classYes, PivaBox CSS Specificity Calculator is completely free to use. There are no charges, subscriptions, or hidden fees. All calculation runs locally in your browser.
Specificity is calculated as a three-component value (a, b, c) where <strong>a</strong> counts ID selectors, <strong>b</strong> counts class selectors, attribute selectors, and pseudo-classes, and <strong>c</strong> counts type selectors and pseudo-elements. The total value is calculated as a*100 + b*10 + c. Higher values win in the cascade.
Inline styles (style attribute on an HTML element) always override stylesheet rules regardless of specificity. The !important flag overrides normal specificity rules — an !important rule beats a non-!important rule. When two !important rules conflict, normal specificity determines the winner. The tool includes notes explaining both of these edge cases.