Counting words seems like counting spaces plus one. It isn’t, because text contains punctuation, symbols, line breaks, numbers and languages that don’t use spaces at all. Every word counter makes decisions, and different decisions produce different totals.
The basic method
Almost every counter works in two steps:
- Split the text into pieces at word boundaries: spaces, tabs and line breaks, sometimes also dashes or slashes.
- Filter the pieces, keeping only those that look like words.
Splitting on single spaces alone fails immediately: two spaces in a row create an empty “word”, and a line break without a space joins two words together.
Where counters disagree
| Text | Common results | Why |
|---|---|---|
don’t | 1 | Apostrophes inside words don’t split them anywhere. |
well-known | 1 (sometimes 2) | Most tools treat a hyphenated compound as one word. |
yes—no | 1 or 2 | Depends on whether an unspaced em dash is treated as a separator. |
A / B | 2 or 3 | Depends on whether a standalone slash counts. |
3.14, 1,000 | 1 | Numbers are generally one word. |
example.com | 1 | Usually one; some tools split at periods. |
– alone | 0 or 1 | Depends on whether punctuation-only pieces are filtered out. |
In ordinary prose these cases are rare, so different counters usually agree closely.
Languages without spaces
Chinese and Japanese are written without spaces between words. Identifying words in them requires a dictionary-based segmenter, and even then native speakers disagree about boundaries. Word processors therefore usually count each character as a word in these scripts. Thai, Lao, Khmer and Burmese also lack spaces between words; simple counters, including ours, undercount them.
The rules TexaDocBase uses
- Split at any whitespace and at en and em dashes (– and —).
- A piece counts as a word only if it contains at least one letter or digit, in any script.
- Characters inside a piece, such as apostrophes, hyphens, periods and @, don’t split it: don’t, well-known, 3.14, e.g. and name@example.com are each one word.
- Each Han character, hiragana and katakana counts as one word.
When comparing or listing words (for unique-word and frequency counts), punctuation at the edges is removed (“(word),” becomes “word”), text is normalized to Unicode NFC, curly apostrophes become straight ones, and case is ignored unless you ask otherwise.
Which count is “right”?
None of them. If a limit is enforced by software, such as a university submission system or a publisher’s portal, that software’s count is the one that matters. Otherwise any consistent method is fine. The Word Counter lists its rules so you can see where it may differ.