b2KIT

Page Word Count Tool

Analyze HTML content for visible word count, excluding navigation, headers, and footer content regions.

Tested tool guide Text and writing tools Checked August 16, 2026

What Page Word Count Tool does, with a checked example

This tool counts the words a reader actually sees on an HTML page. Paste the page's source in, and it parses the markup locally in your browser, strips scripts, styles, and comments, drops content inside <nav>, <header>, and <footer> regions, then counts the words in the text that remains. The result is body content only, which is the thing users most often misjudge: it is far lower than the raw source's word count, because markup, attributes, and boilerplate never contribute.

Worked example

A concrete input and expected output from the current implementation.

Input

<!DOCTYPE html>
<html>
<head><title>Sample page</title></head>
<body>
  <nav>Home About Contact</nav>
  <main>
    <h1>Five words in this heading</h1>
    <p>The quick brown fox jumps over the lazy dog.</p>
    <p>Second paragraph with four words here.</p>
  </main>
  <footer>Copyright 2026 Example Corp. All rights reserved.</footer>
</body>
</html>

Expected output

20 words (visible content only; navigation and footer excluded)

The heading and both paragraphs are page content: 5 + 9 + 6 = 20 words. The three nav links and the footer sit inside excluded regions, and the <title> is not rendered body text, so none of them contribute to the count.

How the result is produced

1

Removal before counting

The HTML is parsed into a document, then everything a reader never sees is dropped: scripts, styles, comments, and elements the markup itself marks as hidden (the hidden attribute or an inline display:none). Content inside <nav>, <header>, and <footer> regions is excluded next. Only the text of what remains is kept. Because the input is parsed rather than scanned as a string, tags and attributes can never leak into the total.

2

What counts as a word

The surviving text is split into tokens with repeated whitespace collapsed, and the report shows the number of tokens. Attached punctuation does not add tokens, so 'dog.' is one word and '2026' is one. The count is computed after the excluded regions are removed, so it cannot be reproduced by counting words in the raw source. Token rules differ between tools, so expect small differences from a word processor's count.

Good uses

  • Checking a draft page against a word-count brief. An article that must land between 400 and 600 words can be verified against the count of its actual body copy, without the menu, breadcrumbs, and footer inflating the total.
  • Comparing how much content competing product pages or blog posts carry. Pages that share a template have identical navigation, so only a count that excludes the chrome reveals which one actually has more written content.
  • Auditing a landing page for thin content before writing or buying copy. If the visible word count is barely above what its nav and footer contribute, the page has little real body copy, even when the source looks long.

Limits and checks

  • Non-semantic markup is not recognized as chrome. Sites that build menus and footers from <div> elements with class names like 'menu' or 'footer' give the tool no <nav>, <header>, or <footer> tags to exclude, so that text is counted and the total overstates the real body copy.
  • Visibility that depends on an external stylesheet cannot be judged from pasted HTML. The hidden attribute and inline display:none are caught, but an element hidden only by a rule in a linked .css file is still counted as visible, since the stylesheet is not part of what you paste.
  • The number is a content count, not a total page count. Header, nav, and footer text is excluded by design, so the result will be lower than any count of the whole source. That is the tool's purpose, not a bug, but it makes the figure unsuitable for comparing against 'words on the page' estimates from raw counters.

Common questions

Does the title, alt attributes, or script text count?

No. Scripts and styles are stripped before counting, and the <title> element plus attributes such as alt and title are markup metadata rather than text rendered in the page body, so they do not contribute. The count reflects what a reader sees. If you are auditing alt text for accessibility, check those attributes separately.

Can I paste a URL instead of the HTML source?

No. The tool counts HTML you paste in; it does not fetch another site's page for you, which is also why the markup never leaves your browser. To get a page's source, open it, use View Source or Developer Tools, select all, copy, and paste it here. A bare link pasted in produces no count.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools