Menu

Search toolsChangelog

to move to openDescribe the problem, not the tool

Guide answer

Does a hyphenated word count as one or two?

It depends on the rule the counter is using. Editorial counters often treat a lexical compound such as “well-being” as one word, while a simple whitespace counter also returns one only by accident and may fail on punctuation or scripts without spaces. A search or programming tool may split on the hyphen because it wants two searchable tokens. The defensible result is therefore the one whose segmentation rule is named and applied consistently, not the one with the most familiar total.

What to take away
  1. Whitespace counting is a useful rough measure, not a language-aware definition of a word.

  2. Hyphens and apostrophes need an explicit policy; two reputable products may intentionally return different totals.

  3. Unicode-aware segmentation matters most for languages that do not put an ASCII space between every word.

The full explanation

Paste the same paragraph into two word counters and you can get two answers. Neither is broken: a word is not a well-defined unit, and every tool has to pick a rule. The same is true of lines, of case conversion, and of the commas in a CSV — text looks simple and is full of decisions. Read the complete guide for the reasoning, examples and definitions behind this answer.

Use the idea

Sources