CSS & Layout

CSS Specificity Calculator

Work out the specificity of any CSS selector and see which selector wins a conflict. Everything runs locally in your browser — nothing is uploaded.

Runs in your browser v1.0.0

Selectors

one per line

One selector per line, or paste a whole stylesheet — the selectors are pulled out automatically. Commas inside :is(), :not() and attributes are kept intact.

Specificity

live

How specificity is counted

Specificity is a three-part score (a, b, c). a counts ID selectors (#id). b counts classes (.class), attribute selectors ([type="text"]) and pseudo-classes (:hover). c counts type selectors (div) and pseudo-elements (::before). The universal selector * and combinators add nothing. :is(), :not() and :has() take the specificity of their most specific argument, while :where() always adds zero.