Word Frequency Analysis: How to Count Words and What the Counts Can (and Can't) Tell You
Word frequency analysis counts how often each word or short phrase occurs in a text and divides each count by the text's length, so that texts of different sizes can be compared as rates per 1,000 words. The counts depend on choices made before counting: what counts as a word, whether case is ignored, and whether stop words are removed. They show what a text talks about, not what it says about it: meaning, word sense and negation need the words read in context.
Last updated · by the simstat.com editorial team · How we write
What a word count does
A word frequency list is the simplest thing you can compute on a text: split it into words, tally each one, and sort the tallies from most to least frequent. It is often the first step in text analysis because it is fast, needs no coding scheme, and gives a rough map of what a text is about.
Two distinctions run through everything that follows. Tokens are the running words of a text, counted every time they occur; Jurafsky and Martin (2026) call these word instances. Types are the distinct words: in their words, “We call the set of unique words in a corpus the word types.” A sentence with the three times has three tokens of one type.
Raw counts have two problems. The most frequent words in any text are grammatical ones: Jurafsky and Martin (2026) note that the most frequent words in Shakespeare, “as in any other corpus, are the short function words like articles, pronouns, prepositions”. And counts grow with length, so a long report will use almost every word more often than a short one. The first problem is handled with a stop-word list, the second by dividing by length.
The formula
Write N for the number of tokens in a text and for the number of times term t occurs. The relative frequency of t is its share of the text, and a rate expresses the same share per k words of running text:
Here t can be a single word or a phrase of several words (an n-gram; our counter goes up to three), and N is always the total number of words, so the shares of words and phrases are on the same scale. McEnery and Hardie (2012) describe a normalised frequency as answering the question “how often might we assume we will see the word per x words of running text?”, and note that normalised frequencies “are usually given per thousand words or per million words”. The number of types is written V.
What counts as a word
Before anything is counted, a tokeniser decides where words begin and end, and every decision changes the counts. Anthony (2022) puts it plainly in the help for his concordancer: “The token definition determines what tokens your corpus is comprised of.” Our tools use one rule: a word is a run of letters or digits, and an apostrophe or hyphen counts only between two such characters. Everything else separates words.
- Case folding. Our counter lower-cases every word, so We and we are one type. Jurafsky and Martin (2026) ask whether a capitalised and an uncapitalised string should be the same type and answer: “it depends on the task!” Folding suits most topic counts, but it also turns US into us.
- Hyphens. Our tokeniser, like the Penn Treebank standard that Jurafsky and Martin (2026) describe, “keeps hyphenated words together”. The House Divided project’s transcription of the Bliss copy of the Gettysburg Address writes battle-field and resting-place. Put those spellings into the text used below and our counter finds 270 words instead of 271, because resting-place is now one word, and battle-field becomes a different type from battlefield. Count each part of a hyphenated word separately and the total is 272. That project reports 272 words for its copy, which also differs from ours in two other words, so a published count is only comparable when the text and the rules match.
- Apostrophes. don’t and nation’s are single words, and curly apostrophes count as straight ones.
- Spelling variants. can not is two words and cannot is one. The worked example shows how much that changes a ranking.
- Word forms. Our counter does not merge dedicate and dedicated; each form is its own type. Use a wildcard search in the concordance, or add the counts yourself, when you want the family.
Stop words and phrases
A stop-word list removes function words (articles, pronouns, auxiliaries, prepositions, conjunctions) so that content words rise to the top. Nothman, Qin and Yurchak (2018) explain that stop words “are presumed to be not informative as to the meaning of documents”. Our counter’s stop filter is on by default. It drops single stop words, and it drops any phrase that starts or ends with one, but keeps stop words inside a phrase, so birth of freedom survives.
Every list is a set of judgements, and those judgements have costs. Nothman, Qin and Yurchak (2018) compared popular English stop lists and warned that users who apply them blindly may meet “surprising omissions and inclusions”. They also noted that “most lists stop not”. Ours does, with no, never and nor, but the counter keeps them by default (“Keep negations”), with cannot and contractions such as don’t: dropping not costs little for topics and a great deal for attitudes. The list has 168 words and treats every form of a pronoun alike (we, us, our).
Phrase counts stop at punctuation. Our counter splits the text at full stops, commas, semicolons, colons, question and exclamation marks, brackets, double quotation marks, en and em dashes and line breaks before it forms two- and three-word phrases, so the last word of one clause and the first of the next are never counted as a phrase. This is a choice, not a law: Anthony (2022) lists filter options for his n-gram tool that decide whether a cluster can include punctuation. Our keyword-in-context tool matches phrases across punctuation, so a phrase search there can return more lines than the phrase count here.
A worked example
The passage is Abraham Lincoln’s Gettysburg Address (1863) in the Bliss copy, the version engraved in the Lincoln Memorial, as transcribed by the National Park Service; the speech and the transcription are in the public domain. The transcription marks Lincoln’s dashes with a tilde, which we print as dashes, and we leave out the quotation marks around the speech; no word changes. The National Park Service notes that the manuscript copies of the address vary “slightly in wording and punctuation”, so published word counts differ with the copy and the counting rules.
Worked example: the Gettysburg Address, counted with the tool's defaults
Totals. The address has 271 words (tokens) and 138 types. Without case folding there would be 142 types: We at the start of a sentence would count apart from we, for example. The default filter removes 150 of the 271 words (55%), from just 45 types.
Default settings (single words and two- and three-word phrases, stop words removed, negations kept). The tool lists 171 distinct terms and shows the first 50. The top of the table:
| Rank | Term | Words | Count | % of words | Per 1,000 words |
|---|---|---|---|---|---|
| 1 | nation | 1 | 5 | 1.85 | 18.5 |
| 2 | not | 1 | 5 | 1.85 | 18.5 |
| 3 | dedicated | 1 | 4 | 1.48 | 14.8 |
| 4 | dead | 1 | 3 | 1.11 | 11.1 |
| 5 | great | 1 | 3 | 1.11 | 11.1 |
| 6 | people | 1 | 3 | 1.11 | 11.1 |
not ties with nation because the counter keeps negations. With the filter on, no two- or three-word phrase occurs more than 1 time, so every phrase sits in the long alphabetical tail of the table.
Filter off. Untick “Remove stop words” and the top of the table changes completely:
| Rank | Term | Count | % of words |
|---|---|---|---|
| 1 | that | 13 | 4.80 |
| 2 | the | 11 | 4.06 |
| 3 | we | 10 | 3.69 |
| 4 | here | 8 | 2.95 |
| 5 | to | 8 | 2.95 |
| 6 | a | 7 | 2.58 |
| 7 | and | 6 | 2.21 |
Nation falls to rank 12. The most frequent phrases now appear, each 3 times: can not, it is, the people, to the, we can and we can not.
What the filter keeps and hides. Here occurs 8 times, more than any word the filter keeps, and ranks 4 with the filter off; with the default list, every reference to this place disappears, as do we (10) and us (3). Not (5) stays, with not dedicate, not consecrate, not hallow and not perish; can not (3) and shall not (2) are dropped because they start with a stop word. Never survives in never forget. Untick “Keep negations” and 0 rows contain a negation: every sign that the speech is about what the living can not do disappears.
One spelling. Project Gutenberg’s e-text prints cannot. Change only that spelling and count again: the address now has 268 words. Not drops to 2 occurrences (rank 16), while cannot (3 times) is kept as a negation at rank 3, with cannot consecrate, cannot dedicate and cannot hallow. A count of not alone would miss three of the five negations.
Rates. The word nation occurs 5 times in 271 words: 1.85 per cent, or 18.5 per 1,000 words (184.5 per 10,000). In a text this short, a single occurrence moves the rate by 3.7 per 1,000.
Different lengths. Split the address where it turns from the occasion to the task, at But, in a larger sense. The word we occurs 4 times in the first part (102 words) and 6 times in the second (169 words). The raw count is higher in the second part, but the rate is higher in the first: 39.2 against 35.5 per 1,000 words. With counts this small, neither difference means much; the point is that counts and rates can point in opposite directions.
These numbers come from the code behind our tool, so they match it exactly. Paste the address into the counter with its default settings to get the first table, and untick “Remove stop words” for the second. The tool shows the percentage; move the decimal point one place to the right for the rate per 1,000. Pasting straight from the National Park Service page gives the same tables: the counter ends a phrase at a tilde, just as it does at a dash.
What the counts cannot tell you
A frequency list strips every word of its context. That is what makes it fast, and it is also its limit:
- Meaning. The list says dedicated occurs 4 times; it cannot say what is dedicated to what.
- Sense. One spelling can carry several senses, and the count adds them together.
- Negation. not satisfied adds to the count for satisfied. Keeping negations lets the phrase not satisfied appear in the table, but the single-word count still adds the two together.
- Emphasis and order. The final sentence of a speech counts the same as a passing aside.
The next step is to read the frequent words in context. Our guide to keyword in context (KWIC) takes the same address, reads every dedicat- word in its sentence, sorts the readings into senses and finds the one negated line.
How to report it
A reader should be able to reproduce every count. For the example above:
In the Gettysburg Address (Bliss copy, National Park Service transcription; 271 words, 138 word types), the most frequent content word was nation (5 occurrences, 18.5 per 1,000 words). Words were runs of letters and digits with internal apostrophes and hyphens, lower-cased, with no stemming; an English stop-word list was removed before ranking, keeping not, no, never and nor.
Include:
- the texts, the edition or transcription, and N for each;
- the tokenisation rules: case folding, hyphens, apostrophes, numbers, and any spelling you standardised;
- the stop list, or a link to it, and any words you added or removed. Nothman, Qin and Yurchak (2018) recommend that stop lists “be documented with their assumptions about tokenization”;
- whether phrases may cross punctuation, and the minimum count;
- raw counts alongside rates, and the base of the rate (per 1,000, per million).
Common mistakes
Comparing raw counts across texts of different lengths. A word used twice as often in a text twice as long is used at the same rate. Compare rates, and report the counts as well.
Comparing type counts across lengths. Vocabulary keeps growing as a text gets longer: Jurafsky and Martin (2026) say that “the vocabulary size for a text goes up a little faster than the square root of its length in words”. So the type-token ratio V/N (0.51 for the address) falls as a text gets longer; McEnery and Hardie (2012) warn that “only similar-sized corpora can be compared in this way”.
Feeding rates into a significance test. Tests of a difference between two texts need the raw counts and the sizes. McEnery and Hardie (2012) put it bluntly: “you should never use normalised frequencies as the input data.”
Trusting the stop list without reading it. Check whether it removes negations, modal verbs or words central to your topic, such as here in the address. Turn the filter off when function words are part of the question.
Mixing transcriptions or tools. can not and cannot, battle-field and battlefield: two versions of the same text, or one text in two tools, give different counts. Fix the source and the rules before you compare.
Treating the top of the list as the finding. A frequent word is a reason to look, not a result. Read its lines in context before you report what the text says.
Where to go next
The text analysis hub collects our tools and guides for counting and reading words. Continue with keyword in context to read frequent words in their sentences, and with the qualitative research hub if the counts are the start of coding interviews or open-ended answers.
References
- Jurafsky, D. & Martin, J. H. (2026). Speech and Language Processing (3rd ed. draft), Chapter 2: Words and Tokens. Stanford University (draft of 19 August 2026).
- McEnery, T. & Hardie, A. (2012). Statistics in corpus linguistics (companion website to Corpus Linguistics: Method, Theory and Practice). Cambridge University Press and Lancaster University.
- Nothman, J., Qin, H. & Yurchak, R. (2018). Stop Word Lists in Free Open-source Software Packages. Proceedings of Workshop for NLP Open Source Software (NLP-OSS), 7–12, Association for Computational Linguistics.
- Anthony, L. (2022). AntConc (Windows, MacOS, Linux) Build 4.1.1: Help. Waseda University.
- Lincoln, A. (1863). Gettysburg Address (Bliss copy), transcription. National Park Service, Lincoln Memorial.
- Lincoln, A. (1863). Address at Soldiers' National Cemetery, Gettysburg, PA (Bliss copy), with word count. House Divided Project, Dickinson College.
- Lincoln, A. (1973). Lincoln's Gettysburg Address (eBook #4). Project Gutenberg.
Try it
- Word frequency counter: count words and phrases: Count the frequency of words and 2–3-word phrases in any text, with a stop-word filter and CSV export.
- Keyword in context (KWIC): See every occurrence of a word or phrase with its surrounding text, sortable and exportable as CSV.