CSS Specificity Calculator
100% LocalCalculate and compare CSS selector specificity with visual breakdown.
IDs (A)
1
Classes (B)
2
Elements (C)
1
Score
121
Specificity notation
(1,2,1)
Paste a CSS selector to see its specificity score broken down by ID, class, and element weight.
Learn More
CSS Bridge: Refining AI-Generated UI for Production Performance
CSS Color Formats in 2026: HEX, RGB, HSL, and OKLCH Explained
CSS Container Queries: Responsive Design Beyond the Viewport
Stop relying solely on media queries. Learn how to use CSS Container Queries to build truly modular components that respond to their parent's size.
What is CSS Specificity Calculator?
Frequently Asked Questions
Technical Deep Dive
CSS Specificity Calculator
Instantly calculate the specificity of any CSS selector, broken into IDs (A), classes/attributes/pseudo-classes (B), and elements/pseudo-elements (C). Compare multiple selectors ranked by specificity, load example selectors, and read the built-in specificity reference guide covering :is(), :not(), :where(), and !important.
Pixel-Precise Output
Generates CSS, tokens, or assets that match what your design system expects.
Live Visual Preview
See changes the moment you make them, no copy-paste cycle between tool and IDE.
Copy-Paste Ready
Output is formatted for direct use in stylesheets, Tailwind configs, or Figma tokens.
01 Specificity Weight Matrix
| Tier | Target Selectors | Weight Tuple | Hierarchy |
|---|---|---|---|
| IDs | #header, #nav | (1, 0, 0) | Highest |
| Classes | .btn, [type], :hover | (0, 1, 0) | Medium |
| Elements | div, p, ::before | (0, 0, 1) | Lowest |
| Global | *, :where(), > | (0, 0, 0) | No Weight |
02 Cascade Calculation Pipeline
:is() and :not() is applied by taking the max specificity of arguments.