# How Word Count Is Calculated

> A word count seems simple: count the words. But a computer has to decide what a word is, and text is full of edge cases such as hyphens, apostrophes, numbers, abbreviations, web addresses and non-English scripts. This guide explains the method used by WordCounter.pk and how it compares to other programs.

- URL: https://wordcounter.pk/guides/how-word-count-is-calculated/
- Type: Guide
- Updated: 2026-10-15

**Short answer:** The counter splits text into tokens made of letters and numbers, keeping apostrophes, hyphens and internal punctuation such as the dots in “U.S.A.” inside a token. Each token that contains a letter or number counts as one word.

## Step 1: clean the text

Before counting, invisible characters such as zero-width joiners are removed so that they do not split words. This matters especially for Urdu and other right-to-left scripts, where such joiners are used to control how letters connect. Line breaks and tabs are treated as spaces between words.

## Step 2: tokenise

The tokenizer reads the text and extracts runs of Unicode letters, combining marks and digits. A run may be joined to the next by a single apostrophe, hyphen or one of the common internal connectors: full stop, comma, colon, slash, at-sign, underscore and percent sign, but only when another letter or digit follows. This design means “don’t”, “well-known”, “3.14”, “1,250”, “U.S.A.”, “10:30” and “www.example.com” are each one word. A token must contain at least one letter or digit, so a lone dash, bullet or emoji is not a word.

## Examples

| Text | Words counted | Why |
| --- | --- | --- |
| don’t | 1 | Apostrophe inside a word |
| well-known | 1 (2 if hyphens split) | Hyphen joins letters; optional setting |
| 2026 | 1 | Numbers are words |
| 1,250 | 1 | Comma between digits |
| 3.14 | 1 | Decimal point between digits |
| U.S.A. | 1 | Dots between letters |
| www.example.com | 1 | Dots between letters |
| and/or | 1 | Slash between letters |
| word—word (em dash) | 2 | An em dash is not a connector |
| — (alone) | 0 | No letter or digit |
| 😀 | 0 | Emoji are counted separately |
| اردو متن | 2 | Unicode letters, any script |

Two options on the main counter, **Hyphen = 2 words** and **Skip numbers**, let you match a rulebook that differs. See [Do Hyphenated Words Count as One or Two?](https://wordcounter.pk/guides/do-hyphenated-words-count-as-one-or-two/) and [Do Numbers Count as Words?](https://wordcounter.pk/guides/do-numbers-count-as-words/).

## Step 3: count related units

Characters are counted as Unicode code points, with and without whitespace. Sentences are found by splitting at . ! ? … and the Urdu ۔ and ؟ when followed by a space or the end of text, and at line breaks. Paragraphs are blocks separated by blank lines. Reading time divides words by 238 and speaking time by 130, as explained in [How Reading Time Is Calculated](https://wordcounter.pk/guides/how-reading-time-is-calculated/).

## Why counters disagree

Microsoft Word, Google Docs and online tools each make slightly different choices. Word splits strictly on spaces, so “word—word” without spaces is one word in Word. Google Docs treats an em dash as a separator. A tool that counts every run of letters would split “U.S.A.” into three. Over a 5,000-word document, these differences usually amount to a handful of words. If a portal has its own counter, its figure is final; see [How Microsoft Word Counts Words](https://wordcounter.pk/guides/how-microsoft-word-counts-words/) and [How Google Docs Counts Words](https://wordcounter.pk/guides/how-google-docs-counts-words/) for those programs.

## Frequently asked questions

### Are numbers counted as words?

Yes. See [Do Numbers Count as Words?](https://wordcounter.pk/guides/do-numbers-count-as-words/).

### Are URLs one word?

Yes, as long as they contain no spaces.

### Is there an official definition of a word for word counts?

No. Each program defines its own, which is why totals can differ slightly.

## Related

- [What Counts as One Word](https://wordcounter.pk/guides/what-counts-as-one-word/index.md): Quick-reference rules for contractions, hyphens, numbers, URLs and symbols.
- [How Microsoft Word Counts Words](https://wordcounter.pk/guides/how-microsoft-word-counts-words/index.md): Word’s counting rules for hyphens, dashes, symbols, footnotes and text boxes.
- [Word Counter](https://wordcounter.pk/index.md): The main free word counter for English, Urdu and Roman Urdu.
- [Character Counter](https://wordcounter.pk/character-counter/index.md): Characters with and without spaces, letters, digits, punctuation and bytes.
- [Sentence Counter](https://wordcounter.pk/sentence-counter/index.md): Sentences, average sentence length and structure for English and Urdu text.
- [What Is a Word Counter?](https://wordcounter.pk/guides/what-is-a-word-counter/index.md): Definition, how a word counter works and the units it measures.
- [Do Hyphenated Words Count as One or Two?](https://wordcounter.pk/guides/do-hyphenated-words-count-as-one-or-two/index.md): How hyphens, en dashes and em dashes affect word counts.
- [Do Numbers Count as Words?](https://wordcounter.pk/guides/do-numbers-count-as-words/index.md): How numbers, dates, decimals and currency are counted.

## Images

- ![How Word Count Is Calculated: The step-by-step logic behind word counts, with edge-case examples. (WordCounter.pk cover graphic)](https://wordcounter.pk/img/how-word-count-is-calculated/how-word-count-is-calculated-cover-1200.webp)
- ![What this guide covers: Step 1: clean the text; Step 2: tokenise; Examples](https://wordcounter.pk/img/how-word-count-is-calculated/how-word-count-is-calculated-how-it-works-1200.webp)
- ![Examples: How Word Count Is Calculated: reference table with columns Text, Words counted, Why](https://wordcounter.pk/img/how-word-count-is-calculated/how-word-count-is-calculated-reference-1200.webp)
- ![Map showing how How Word Count Is Calculated connects to Writing Guides, What Counts as One Word, How Microsoft Word Counts Words, Word Counter and more on WordCounter.pk](https://wordcounter.pk/img/how-word-count-is-calculated/how-word-count-is-calculated-related-tools-map-1200.webp)
- ![Quick answer card: Are numbers counted as words? Yes. See Do Numbers Count as Words?.](https://wordcounter.pk/img/how-word-count-is-calculated/how-word-count-is-calculated-quick-answer-1200.webp)

