HTML Entity Counter — Count &, <, etc., Free
Count HTML entities in any text. Lists every named/numeric entity with frequency. Browser-only.
About HTML Entity Counter
HTML entities are escape sequences for special characters: & for &, < for <, > for >, " for ", ☃ for ☃. Counting entities is useful for HTML migration audits ("did we escape everything?"), email-template inspection, and security review (are <script> tags being properly entity-escaped?). The ZTools HTML Entity Counter parses any text, lists every named and numeric entity it finds with frequency, and shows the resolved character for each.
Use cases
- Audit a template for escape consistency. A template uses & in some places and & in others. Counter highlights the mismatch.
- Check user-generated content for unescaped special chars. After a sanitiser runs, count entities. Too few = sanitiser missed cases. Too many = over-escaping.
- Migrate from HTML to Markdown. Markdown rarely needs entities. Counter shows what to convert back to plain chars.
- Decode hex / decimal numeric entities. ☃ → ☃ (snowman). Counter shows the resolved char alongside the count.
How it works
- Paste HTML / text. Any text containing entities.
- Scan. Regex matches &name; (named), &#NNN; (decimal), &#xHHHH; (hex). Each match decoded.
- Count. Frequency table per unique entity. Top entities highlighted.
- Display. Table: entity, decoded char, count. Plus total entity count and total chars.
Examples
Input: "This & that <tag>"
Output: Entities: & (1, decodes to &), < (1, <), > (1, >). Total: 3.
Input: Mixed: "© 2026 — ☃"
Output: © → ©, — → —, ☃ → ☃. 3 entities.
Input: Entity-stuffed text
Output: Counter helps spot if entities are being doubly-encoded (&amp; means & got escaped twice).
Frequently asked questions
Doubly-encoded entities?
When &amp; appears, it means a sanitiser ran twice. Tool flags suspicious patterns like &quot; (escape of ").
Numeric vs named entities?
Named (©, —) more readable; numeric (©, —) more universal. Tool decodes both.
Maximum text size?
Several MB works fine. The regex scan is O(n).
Privacy?
All in browser.
Pro tips
- For HTML output, use named entities for readability — © beats ©.
- For email HTML, more conservative — use entities for any non-ASCII char to avoid encoding mismatches.
- For Markdown migration, decode all entities first — Markdown handles plain chars natively.
- Doubly-encoded entities (&amp;) are a security smell — investigate the sanitisation pipeline.
Reviewed by Ahsan Mahmood · Last updated 2026-05-06 · Part of ZTools.
For the full,
formatted version of this page, please enable JavaScript and reload
https://ztools.zaions.com/html-entities.