Instantly calculates specificity for
Instantly calculates specificity for any valid CSS selector.
500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.
Calculate and compare the specificity score of any CSS selector to understand cascade order and override priority.
The CSS Specificity Calculator parses any CSS selector and computes its specificity score as a three-number tuple (a, b, c) representing inline styles, IDs, and classes/attributes/pseudo-classes respectively, plus the total specificity for comparison. Specificity determines which rule wins when multiple selectors target the same element — higher specificity overrides lower, regardless of source order, unless !important is used. The tool accepts multiple selectors for side-by-side comparison and ranks them so you can immediately see which selector wins. It handles compound selectors, pseudo-classes, pseudo-elements, attribute selectors, :not(), :is(), :where(), and :has().
Instantly calculates specificity for any valid CSS selector.
Side-by-side comparison shows which selector wins the cascade.
Explains each component (IDs, classes, elements) with a breakdown.
Handles modern pseudo-classes including :is(), :where(), and :has().
Instantly calculates specificity for any valid CSS selector — no manual counting needed.
Side-by-side comparison shows which selector wins the cascade and by how much.
Input: .sidebar .nav-item.active
Output: Specificity: (0, 3, 0) — three classes/pseudo-classes, no IDs, no elements.
Input: #header .logo:hover vs .header .logo:hover
Output: (1, 2, 0) vs (0, 3, 0) — the ID-prefixed version wins regardless of source order.
Input: :where(#main, .container) p
Output: Specificity: (0, 0, 1) — :where() contributes 0; only the p element counts.
Input: :is(#a, .b, span) p
Output: Specificity: (1, 0, 1) — :is() picks up #a's ID weight, plus the trailing p element.