Skip to main content

CSS Specificity Calculator

Calculate the specificity of any CSS selector in (inline, ID, class, element) notation. Compare two selectors to see which one wins the cascade.

.nav #logo:hover
0Inline
1ID
2Class/Attr
0Element
(0,1,2,0)

Score: 10200

Specificity Scoring Rules

0,1,0,0ID selectors#header, #nav
0,0,1,0Class / attribute / pseudo-class.btn, [type], :hover
0,0,0,1Element / pseudo-elementdiv, p, ::before
0,0,0,0Universal selector*, combinators

Try an example

Share this tool: X / Twitter LinkedIn
โœ“ 60,000+ developers use DevPlaybook โ˜…โ˜…โ˜…โ˜…โ˜… 4.8 / 5 on Gumroad โœ“ MIT licensed ยท Instant download โœ“ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • โšก AI Code Review, Doc Generator & SQL Builder
  • โšก All premium templates & early access
  • โšก Member discounts on Gumroad products
Start Free Trial โ†’

$9/mo after trial ยท Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products โ€” grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro โ€” $79 โ†’

MIT licensed ยท Instant download ยท No subscription

See what's included โ†’ Browse all deals โ†’