<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Fei Ning · Koumen Tools</title>
    <description>The latest articles on DEV Community by Fei Ning · Koumen Tools (@koumen).</description>
    <link>https://dev.to/koumen</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4229899%2F5691b00e-d4f1-4450-84d3-63573baaf6cc.jpg</url>
      <title>DEV Community: Fei Ning · Koumen Tools</title>
      <link>https://dev.to/koumen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/koumen"/>
    <language>en</language>
    <item>
      <title>How to count words in a document, step by step</title>
      <dc:creator>Fei Ning · Koumen Tools</dc:creator>
      <pubDate>Fri, 06 Nov 2026 11:24:53 +0000</pubDate>
      <link>https://dev.to/koumen/how-to-count-words-in-a-document-step-by-step-53pi</link>
      <guid>https://dev.to/koumen/how-to-count-words-in-a-document-step-by-step-53pi</guid>
      <description>&lt;p&gt;Counting words in a document takes less than a minute if you use the right tool for the format. Open the file, select all, and read the count your editor already shows. If you are working in a browser or need a count without installing anything, paste the text into a page like the &lt;a href="https://tool.koumen.net/tools/words/" rel="noopener noreferrer"&gt;Word Counter&lt;/a&gt; and read the number it returns. The steps below cover the three common situations: a document you can edit, a PDF, and plain text. Each step includes the failure mode that makes the count wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Open the document in an editor that shows a live count
&lt;/h2&gt;

&lt;p&gt;If the file is a .docx, .odt, .rtf, or .txt, open it in a word processor. Most editors display a running word count in the status bar at the bottom of the window. Click that number to open a dialog with more detail: words, characters with and without spaces, paragraphs, and lines. The failure mode here is trusting the status bar after you have closed and reopened the file. Some editors cache the count until you press a key. Click into the body of the document and press an arrow key once, then read the number again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Select the text you actually want counted
&lt;/h2&gt;

&lt;p&gt;If you want a count for a section rather than the whole file, select that section before you read the count. In most editors, selecting text changes the status bar to show the selected word count. The failure mode is selecting with the mouse and missing a trailing paragraph mark or a line break. Press Ctrl+A or Cmd+A to select everything first, then hold Shift and click the start of the section to adjust the selection. For a section count, place the cursor at the start, hold Shift, and click the end. The status bar should now read something like "Selected: 412 words."&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Include or exclude headers, footnotes, and text boxes
&lt;/h2&gt;

&lt;p&gt;The default count in most word processors includes footnotes, endnotes, and text in headers and footers. That is usually wrong for a submission with a word limit. Open the word count dialog and look for a checkbox labeled "Include textboxes, footnotes and endnotes." Clear it if the limit applies only to the body. The failure mode is assuming the dialog setting applies to the status bar. In several editors it does not; the status bar count always includes those elements. To get a body-only count, select the main text from the first word to the last and read the selected count instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Handle hyphenated words and numbers the same way every time
&lt;/h2&gt;

&lt;p&gt;Word processors differ on how they treat hyphenated compounds. Some count "well-known" as one word, others as two. Numbers like "2024" count as one word; "$1,200.50" also counts as one word in most editors. If the document has many hyphenated terms, the count can vary by a few percent between editors. The failure mode is comparing a count from one program to a limit set by another. Do the final count in the same program the recipient will use, or agree on a rule: count hyphenated words as one and numbers as one. Then apply that rule by checking a sample paragraph manually.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Count words in a PDF
&lt;/h2&gt;

&lt;p&gt;PDFs do not store words the way text files do. Open the PDF in a viewer and try to select all the text. If the selection covers the whole page as one block, the file has a text layer. Copy the selected text and paste it into a word counter or a blank document. The failure mode is a scanned PDF, which has no text layer. Selecting gives you either nothing or a single image. In that case the count has to come from OCR or from the original source file. Do not guess. If you only have the scan, run OCR in a tool that handles it locally, then count the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Paste into a browser word counter for a second opinion
&lt;/h2&gt;

&lt;p&gt;When you need a count without opening a full editor, or you want to check a selection after pasting from a PDF, paste the text into a browser tool. The Word Counter runs in the page and updates as you type. Paste with Ctrl+V or Cmd+V, then read the word and character counts. The failure mode is pasting formatted text that carries hidden line breaks. Those breaks &lt;a href="https://tool.koumen.net/tools/pdf-split/" rel="noopener noreferrer"&gt;split&lt;/a&gt; words and inflate the count. Paste as plain text first (Ctrl+Shift+V in most browsers) to strip formatting and keep the count honest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Format trade-offs and what breaks
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Format&lt;/th&gt;
&lt;th&gt;How to get a count&lt;/th&gt;
&lt;th&gt;What usually breaks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;.docx / .odt&lt;/td&gt;
&lt;td&gt;Status bar or word count dialog&lt;/td&gt;
&lt;td&gt;Headers and footnotes included by default; dialog setting not applied to status bar&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.pdf with text layer&lt;/td&gt;
&lt;td&gt;Select all, copy, paste into counter&lt;/td&gt;
&lt;td&gt;Line breaks split hyphenated words; ligatures and special characters miscount&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.pdf scanned&lt;/td&gt;
&lt;td&gt;OCR first, then count&lt;/td&gt;
&lt;td&gt;No text layer means no count; OCR errors merge or split words&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Plain text (.txt)&lt;/td&gt;
&lt;td&gt;Editor status bar or browser counter&lt;/td&gt;
&lt;td&gt;Trailing spaces and tabs counted as characters, not words&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Web page or email draft&lt;/td&gt;
&lt;td&gt;Browser counter or editor count&lt;/td&gt;
&lt;td&gt;Signature blocks and quoted replies inflate the count&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Special cases that change the number
&lt;/h2&gt;

&lt;p&gt;Tables: most editors count each cell as separate words. A table with many short cells can add hundreds of words to the total. If your limit excludes tables, select only the paragraphs outside the table. Bulleted and numbered lists count normally, but the bullet character itself does not count as a word. Citations: bracketed references like [1] count as one word. If the style guide excludes citations, remove them before counting. Track changes: a document with tracked changes counts both inserted and deleted text in some editors. Accept or reject all changes before you take the final count.&lt;/p&gt;

&lt;h2&gt;
  
  
  When this does not apply
&lt;/h2&gt;

&lt;p&gt;This method does not apply when the word limit is defined by a publisher or court rule that specifies its own counting method. Some rules count characters instead of words, or count words in a specific section only. Follow the rule, not the editor default. This method also does not apply to languages without spaces between words, such as Chinese or Japanese, where a word count depends on a segmentation dictionary. In those cases use a counter built for that language. And if the document is a form with fixed fields, the count is whatever the form says it is; do not recount it by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  A note on privacy
&lt;/h2&gt;

&lt;p&gt;File tools on Koumen Tools run in the browser, so the document never leaves your machine when you use them. That matters for contracts, medical records, and anything under a confidentiality agreement. The word counter is one of them. If you are counting a client document, keep the file local and paste only the text you need into the counter, or use the editor's built-in count.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;How do I count words in a PDF without selecting all the text?&lt;/strong&gt;&lt;br&gt;
Open the PDF in a viewer that has a word count feature, or copy the text page by page into a word counter. If the PDF is a scan, you must run OCR first; there is no shortcut.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does my word count change when I open the document in a different program?&lt;/strong&gt;&lt;br&gt;
Different programs treat hyphenated words, numbers, headers, and footnotes differently. Pick one program for the final count, or agree on a rule with the recipient and apply it manually to a sample.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does a word counter count spaces?&lt;/strong&gt;&lt;br&gt;
Word counts do not include spaces; character counts do. A browser counter usually shows both: words, characters with spaces, and characters without spaces. Use the character count when a limit is set in characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I count words in a Google Doc?&lt;/strong&gt;&lt;br&gt;
Yes. Open the document, go to Tools, then Word count, or press Ctrl+Shift+C on Windows or Cmd+Shift+C on a Mac. The dialog shows the count for the whole document or for a selection, and you can check a box to include footnotes.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  how do i count words in a pdf without selecting all text
&lt;/h3&gt;

&lt;p&gt;Use a PDF viewer that shows a word count, or copy the text page by page into a word counter. If the PDF is a scan, run OCR first. Selecting all often grabs line breaks that split words, so paste as plain text.&lt;/p&gt;

&lt;h3&gt;
  
  
  why does my word count change in different programs
&lt;/h3&gt;

&lt;p&gt;Programs disagree on hyphenated words, numbers, headers, and footnotes. Count in the program the recipient will use, or set a rule and check a sample paragraph manually to keep the number consistent.&lt;/p&gt;

&lt;h3&gt;
  
  
  does a word counter count spaces
&lt;/h3&gt;

&lt;p&gt;Word counts do not include spaces. A word counter usually shows words and characters separately, so use the character count when a limit is set in characters rather than words.&lt;/p&gt;

&lt;h3&gt;
  
  
  can i count words in a google doc
&lt;/h3&gt;

&lt;p&gt;Yes. Open the document and go to Tools, then Word count, or press Ctrl+Shift+C on Windows or Cmd+Shift+C on a Mac. The dialog shows the whole document or just the selection.&lt;/p&gt;

</description>
      <category>pdf</category>
      <category>productivity</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
