Favorite places of your favorite city
Home
Add to preferred sources on Google

CSS Specificity Calculator

Compare the weight of CSS selectors. Open a result to see which parts of the selector contribute to its score.

Selectors

Separate selectors with commas. Limit: 16,384 UTF-16 code units.

Specificity results

Enter selectors to compare their specificity.

Your selectors are processed locally in this browser.

Calculate specificity

  1. Paste selectors separated by commas, or load the worked example.
  2. Select Calculate to get one score for each selector.
  3. Compare the scores and open a row to see its contributing tokens and nested arguments.

Read the three columns

Compare the ID column first, then classes, attributes and pseudo-classes, then type selectors and pseudo-elements.

The functions :is(), :not() and :has() take the greatest score from their arguments. A :where() adds zero, whatever it contains.

The child-position functions add a pseudo-class point and can also count the greatest selector in an of list.

Compare real selectors

In article:is(.featured, #lead) > a:hover, the ID argument wins. The full selector scores (1,1,2).

The selector .card:where(#hero) scores (0,1,0) because only .card contributes.

Supported selectors and cascade context

The editor accepts a strict subset with common pseudo-classes and modern selector functions. Namespaces, nesting references and shadow-specific selectors are outside the profile.

Specificity is one part of the cascade. Origins, importance, layers, scope proximity and source order can affect the result in a stylesheet.

Local calculation

The browser parses your selectors as text. They stay out of application storage and URLs.

CSS specificity questions

Yes. The ID column is compared first, and counts do not carry between columns.

Yes. Separate them with commas. A quoted comma inside an attribute stays in that selector.

The specificity rule assigns zero to the function and its arguments.

Specificity is compared within the relevant cascade context. Use the stylesheet's origin, layers, importance, scope and order to determine the applied declaration.

Sources

References for the scoring rules, cascade and selector parser.

Implementation reviewed November 18, 2026.

CSS Filter Generator

Order and repeat CSS effects, compare a specimen and copy the exact filter declaration.

Open tool — CSS Filter Generator

Fluid Font Size Calculator

Create root-relative CSS from viewport endpoints and inspect the copied size model.

Open tool — Fluid Font Size Calculator

CSS Button Generator

Style native button states, inspect keyboard focus and copy HTML and CSS.

Open tool — CSS Button Generator

CSS Border Generator

Create borders with independent styles, widths, colors and opacity on all four sides.

Open tool — CSS Border Generator

CSS Background Pattern Generator

Create editable stripes, grids, dots and checkerboards. Preview colors and transparency locally, then copy the current CSS declarations.

Open tool — CSS Background Pattern Generator

CSS Clip Path Generator

Edit polygon points and basic shapes, preview the clipping and copy CSS.

Open tool — CSS Clip Path Generator

CSS Border Radius Generator

Edit eight corner radii, preview a box and copy CSS in pixels or percentages.

Open tool — CSS Border Radius Generator

CSS Grid Generator

Build a bounded CSS Grid example with editable tracks, placement and named areas. Preview it, copy CSS or HTML and download the same standalone example.

Open tool — CSS Grid Generator

CSS Flexbox Generator

Build a Flexbox example with container and item controls, explicit layout axes, matching CSS and HTML, and a local complete-example download.

Open tool — CSS Flexbox Generator

CSS Text Shadow Generator

Build ordered text shadows, preview plain text and copy exact CSS.

Open tool — CSS Text Shadow Generator

CSS Transform Generator

Compose repeatable 2D CSS transforms, edit px or percentage translation and origin, inspect a reference box and copy the exact current declarations.

Open tool — CSS Transform Generator

CSS Cubic Bezier Generator

Edit CSS cubic-bezier curves with coordinates, visual handles and presets. Inspect overshoot, run a deliberate comparison with linear motion, and copy easing CSS.

Open tool — CSS Cubic Bezier Generator

CSS Box Shadow Generator

Create ordered CSS box-shadow layers with a live preview and copyable code.

Open tool — CSS Box Shadow Generator

HTML to Markdown

Convert pasted or local HTML into Markdown, review conversion notes, and copy or download the result.

Open tool — HTML to Markdown

JavaScript Regex Tester

Test a JavaScript pattern locally and inspect matches, captures, and UTF-16 positions.

Open tool — JavaScript Regex Tester

Markdown to HTML

Convert a Markdown draft to an HTML fragment, inspect the source and inert preview, then copy or download it.

Open tool — Markdown to HTML

CSS Gradient Generator

Create linear or radial CSS gradients with editable colors, opacity and stops.

Open tool — CSS Gradient Generator

Color Converter

Convert supported sRGB HEX, RGB and HSL literals with alpha, explicit precision and current code Copy.

Open tool — Color Converter

HTML Entity Encoder/Decoder

Encode or decode literal HTML references with explicit context, Unicode options and LF output, without parsing or rendering markup.

Open tool — HTML Entity Encoder/Decoder

Markdown Table Generator

Edit a small literal-text table, set alignment and copy GFM Markdown or import tab-separated text.

Open tool — Markdown Table Generator

HTML Table Generator

Build a rectangular table with captions and headers, then copy HTML and CSS.

Open tool — HTML Table Generator

Query String Parser & Builder

Edit ordered URL parameters, retain repeated names and copy a normalized query or HTTP(S) URL.

Open tool — Query String Parser & Builder

URL Encoder & Decoder

Convert a UTF-8 URL component or form value with explicit space and plus rules, then copy or download the result.

Open tool — URL Encoder & Decoder

Color Contrast Checker

Compare foreground and background colors, adjust opacity and check WCAG numerical contrast thresholds for text and essential interface details.

Open tool — Color Contrast Checker
View all tools in this category