Developer Tools
HTML Tag Counter
Paste HTML and see how many times each tag appears, the deepest nesting level, and attribute usage on common tags. Browser-only.
Counting scope
Choose what part of the parsed document to include.
Tag frequency table
Showing 0 of 0 distinct tags.
How to use
- Paste any HTML page or fragment into the input area. Click Load sample to try the counter with a small example document.
- Choose a counting scope: Whole document includes head tags such as meta and link, Body only skips them and is best for fragments.
- Read the live stats card for total elements, distinct tags, max nesting depth, and the most common tag, then read the frequency table to see every tag with a count and percentage.
- Sort the table by Count or Alphabet and flip Descending or Ascending to look at the lightest or heaviest tags.
- Scroll to the Attribute usage by tag panel to see how many a, img, link, meta, script, input, and button elements use each common attribute.
- Click Copy CSV or Copy plain text to export the table, or click Copy next to any row to grab that tag name.
About this tool
HTML Tag Counter parses any HTML markup and reports a sortable frequency table of every tag it finds. Paste a full page or a fragment and the tool shows the total element count, the number of distinct tags, the deepest nesting level (with the path that reaches it), and the most common tag. A toggle decides whether the count covers the whole document (including head metadata such as meta, link, and title) or only the body, which is convenient when you paste a snippet from inside an article or component. Custom elements (tags whose name contains a hyphen, like a web component) are detected automatically and tagged in the table so you can spot them quickly. For the noisy interactive and metadata tags (a, img, link, meta, script, input, button), a second panel breaks down attribute usage so questions like how many anchors have a rel value, how many images carry an alt text, how many meta tags have a property attribute, or how many scripts are async are answered at a glance. Results can be copied as CSV for spreadsheets or as a plain-text aligned report for changelogs. The HTML is parsed with the browser's built-in DOMParser into a detached document, so any script tags inside the markup are inert and never execute, and nothing you paste is uploaded anywhere.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
HTML Formatter
Pretty-print and minify HTML with indent, wrap, and quote controls.
Open tool
SEOHTML Link Extractor
Pull every <a href> out of HTML with anchor text, rel, target, and internal/external tagging.
Open tool
SEOHTML Headings Extractor
Extract h1-h6 from any HTML, view the outline, and check for skipped or empty headings.
Open tool
TextHTML to Plain Text
Strip HTML tags and convert HTML to readable plain text with optional link URLs.
Open tool
DeveloperHTML Entity Encoder Decoder
Two-way HTML entity encoder and decoder with named, decimal, and hex modes.
Open tool