CSS Specificity Calculator
LiveCSS Specificity Calculator works out the specificity of CSS selectors and shows which one wins.
Runs in your browser: what you enter is processed on your device and not uploaded to MyToolDock.
CSS Specificity Calculator works out the specificity of CSS selectors and shows which one wins.
Runs in your browser: what you enter is processed on your device and not uploaded to MyToolDock.
CSS Specificity Calculator works out the specificity of CSS selectors and shows which one wins. It follows the CSS Selectors Level 4 rules: :is(), :not() and :has() take their most specific argument, :where() counts as zero, and pseudo-elements count as elements. Nesting with & is not supported.
If two selectors tie, the one written later in the stylesheet wins. Inline styles and !important are not counted here.
Type or paste CSS selectors, one per line. A line with commas gives one row for each selector.
Read the three counts and the rank. Rank 1 is the strongest selector; ties share a rank.
Results were compared with the cssselect package on 169 random selectors using IDs, classes, attributes, pseudo-classes, pseudo-elements, combinators and :not(), :is(), :where() and :has(). Cases that package cannot read, such as :nth-child(2 of .x), escaped names and namespaces, were checked against the CSS Selectors Level 4 rules.
Inline styles, !important, cascade layers and source order are not part of selector specificity, so they are not shown. The nesting symbol & is not supported.
IDs first, then classes, attributes and pseudo-classes, then elements and pseudo-elements. A higher count in an earlier place always wins.
It adds nothing, which makes it handy for low-priority defaults.
No. They are processed in your browser.
CSS Specificity Calculator works out the specificity of CSS selectors and shows which one wins. It follows the CSS Selectors Level 4 rules: :is(), :not() and :has() take their most specific argument, :where() counts as zero, and pseudo-elements count as elements. Nesting with & is not supported.
One or more CSS selectors, one per line, or a list separated by commas.
Your selectors stay in your browser and are not uploaded.
Yes, MyToolDock CSS Specificity Calculator is 100% free with no registration, subscriptions, or limits. All features are fully unlocked.
MyToolDock publishes written guides on the topic: Why Front-End Engineers Need a CSS Minifier. Each guide links back to the tools it covers.