🔎 Count Word Occurrences
By ToolNimba Editorial Team · Updated 2026-06-19
Enter your text and a word to count, then press Count occurrences.
This word occurrence counter tells you exactly how many times a word or phrase appears in a block of text. Paste your text, type the term you want to count, and press the button. You will see the total count, where each match sits in the text, and the matches highlighted in place. Toggle case sensitivity or whole-word matching to control what counts. Everything runs in your browser, so your text is never uploaded anywhere.
What is the Word Occurrence Counter?
Counting how often a specific word appears is a deceptively common task. Writers check whether they have overused a phrase, students count keyword mentions in an essay, SEO editors measure how often a target term appears on a page, and developers tally occurrences of a token in logs or code. Doing it by eye is slow and unreliable past a handful of matches, so a counter that scans the whole text at once and reports an exact number removes the guesswork.
Two settings decide what actually counts as a match. Case sensitivity controls whether capitalisation matters: with case-insensitive matching on, a search for "data" also catches "Data" and "DATA", which is usually what you want when counting a concept regardless of where it sits in a sentence. Whole-word matching decides whether the term must stand alone. With it off, searching "cat" also counts the "cat" inside "category" and "scatter". With it on, only the standalone word cat is counted, because the match must sit between word boundaries.
The term you type is treated as literal text, not a search pattern. Characters such as a dot, dollar sign, asterisk, or bracket normally carry special meaning in pattern matching, so the tool escapes them automatically. That means searching for "a.b" counts the literal sequence "a.b" and not "axb", and searching for "$5" counts the literal "$5". This keeps the result predictable: what you type is exactly what gets counted, whether it is a single word, a phrase with spaces, or a string with punctuation.
When to use it
- Checking how many times a keyword appears in an article before publishing.
- Counting mentions of a brand, product, or person across a long document.
- Verifying you have not overused a filler word or phrase in your writing.
- Tallying how often a specific token, error code, or path shows up in pasted logs.
How to use the Word Occurrence Counter
- Paste or type your text into the large text box.
- Enter the word or phrase you want to count in the search field.
- Toggle Case-insensitive on or off depending on whether capitalisation should matter.
- Toggle Match whole word only to exclude matches that sit inside larger words.
- Press Count occurrences to see the total, the highlighted matches, and each match position.
Formula & method
Worked examples
Count "the" in "The cat sat on the mat" with case-insensitive matching on.
- Search term = the
- Case-insensitive on, so "The" and "the" both count
- Matches found: "The" at the start and "the" before mat
- Total = 2
Result: 2 occurrences of "the"
Count whole-word "cat" in "a cat in a category with cats" so only the standalone word counts.
- Search term = cat, Match whole word only on
- The word "cat" counts
- "category" and "cats" are not whole-word matches, so they are skipped
- Total = 1
Result: 1 occurrence of whole-word "cat"
Count the phrase "data set" in a 100-word paragraph where it appears 4 times.
- Search term = data set (a two-word phrase)
- The space is part of the literal term
- Each of the 4 appearances counts as one match
- Density = 4 / 100 x 100 = 4.0%
Result: 4 occurrences, 4.0% of total words
What each option does
| Option | Effect when on | Effect when off |
|---|---|---|
| Case-insensitive | Ignores upper and lower case (data = Data = DATA) | Counts only the exact case you typed |
| Match whole word only | Counts standalone words only (cat, not category) | Counts the term anywhere, even inside larger words |
Example counts for the term "is" in different settings
| Text | Settings | Count |
|---|---|---|
| This is his list | Whole word off, case-insensitive on | 4 (this, is, his, list) |
| This is his list | Whole word on, case-insensitive on | 1 (is) |
| Is it? It is. | Whole word on, case-insensitive off | 1 (the lowercase is) |
| Is it? It is. | Whole word on, case-insensitive on | 2 (Is, is) |
Common mistakes to avoid
- Forgetting that partial matches count by default. With whole-word matching off, counting "art" also counts the "art" inside "part", "smart", and "started". Turn on Match whole word only when you mean the standalone word.
- Missing capitalised matches. If you turn case-insensitive off, a search for "monday" will not count "Monday". Keep case-insensitive on when capitalisation should not matter, which is the default here.
- Including stray spaces in the search term. A trailing or leading space is part of the literal term, so searching "cat " (with a space) will not match "cat" at the end of a sentence. Type the term without extra spaces unless you mean to include them.
- Expecting wildcards or patterns to work. The term is matched as literal text, so symbols like a dot or asterisk count those exact characters, not a pattern. This is intentional and keeps the count predictable.
Glossary
- Occurrence
- A single place in the text where the search term appears, according to your case and whole-word settings.
- Case-insensitive
- A search mode that treats upper and lower case as the same, so "Text" and "text" both count.
- Whole word
- A match that stands alone between word boundaries, so "cat" counts only the word cat and not parts of other words.
- Word boundary
- The edge between a word character (letter, digit, underscore) and a non-word character such as a space or punctuation mark.
- Density
- The share of the total word count made up by your search term, shown as a percentage.
Frequently asked questions
How do I count how many times a word appears in text?
Paste your text into the box, type the word in the search field, and press Count occurrences. The tool shows the total count, highlights every match, and lists the position of each one.
Can I count a phrase, not just a single word?
Yes. Type the full phrase, spaces and all, into the search field. The phrase is matched as a literal string, so each exact appearance is counted as one occurrence.
Does the counter ignore upper and lower case?
By default it does, because case-insensitive matching is on. With it on, "data", "Data", and "DATA" all count toward the same total. Turn it off to count only the exact case you typed.
What does Match whole word only do?
It counts the term only when it stands alone, so counting "cat" will not include the "cat" inside "category" or "scatter". Leave it off if you want to count the term anywhere it appears, including inside larger words.
Can I search for terms with punctuation or symbols?
Yes. Characters like a dot, dollar sign, or bracket are treated as literal text and escaped automatically, so searching for "a.b" or "$5" counts those exact sequences rather than acting as a pattern.
Is my text uploaded or stored anywhere?
No. All counting happens in your browser using plain JavaScript. Your text never leaves your device and nothing is sent to a server.