#app .card button:hover
One ID, two class-level parts, and one type selector gives 1-2-1.
Enter one or two CSS selectors to see their specificity, shown as ids-classes-types, and which one would win a conflict.
A wins
Fill in the values, paste your text, or upload the file this tool works with.
Most tools update live as you type; a few use a single button. Either way, the result appears right on this page.
Copy, download, or share what the tool produces — you're always in control of the output.
Enter one or two CSS selectors to see their specificity, shown as ids-classes-types, and which one would win a conflict.
IDs count the most, then classes, attribute selectors, and pseudo-classes, then element type selectors and pseudo-elements. Combinators like space, >, and ~ don't affect specificity.
`#main .container p` scores 1 id, 1 class, 1 type (1-1-1), while `nav ul li.active a` scores 0 ids, 1 class, 4 types (0-1-4) — the first selector wins despite matching fewer elements by name.
IDs - classes/attributes/pseudo-classes - types/pseudo-elementsOne ID, two class-level parts, and one type selector gives 1-2-1.
All calculation runs in your browser; the selectors you enter are never sent anywhere.
When specificity ties, the rule that appears later in the stylesheet (or has higher CSS layer priority) wins.
No — inline `style` attributes always outrank any selector-based specificity, regardless of what this calculator shows.
No — only which kinds of selectors appear and how many of each, not the order they're written in.
No. This implementation counts each as one pseudo-class, except :where(), which contributes zero. The full CSS spec looks inside those arguments.
Check foreground and background contrast for UI work.
Calculate proportional width or height for media and UI.
Generate clamp(), gradients, shadows, border radius, and grid CSS.
Convert SVG markup to a CSS/HTML data URI and back.
Extract dominant HEX and RGB colors from an image.
Remove extra SVG metadata, comments, and whitespace.
Generate a font size scale from a base size and ratio.
Preview an image under common color vision deficiency modes.
Calculate screen PPI, dot pitch, physical dimensions, and visual sharpness.
Create a polished signature with live preview.