Count how many times a word, phrase or character appears

Enter what you are looking for and the tool counts every match in your text, gives a rate per 100 words, and lists the line and column of each one.

Live demo · real result from this tool
"aa" occurs 3 times in "aaaa" when overlapping.
Occurrences3
Per 100 words
5

Positions

#LineColumnMatch
1127the
2197the
3352the

Processed on your device — nothing is uploaded.

How to use Count Occurrences

  1. Paste the text to search into Your text.
  2. Type the target into Word, phrase or character.
  3. Tick Case sensitive only if “Apple” and “apple” should count separately.
  4. Leave Whole words only ticked to skip matches inside longer words, or untick it to catch every match.
  5. Tick Count overlapping matches for repeated patterns such as “ana” in “banana”.
  6. Read Occurrences and Per 100 words, then use the Positions table to find each match.

What it does and when to use it

This tool answers “how many times?” for one thing you choose. Common uses:

  • checking how often a brand name or keyword appears in a page you are writing;
  • counting a character name in a chapter, or a term in a contract;
  • counting commas, semicolons or a letter in a puzzle;
  • finding every place a word appears, by line and column, before you edit it.

The Per 100 words figure lets you compare texts of different lengths. Three mentions in a 150-word product blurb (2 per 100) is very different from three in a 3,000-word article (0.1 per 100).

If you want counts for every word at once, open the Word Frequency Analyzer. To change the matches rather than count them, use Find and Replace. For counts of characters and words in general, the Character Counter is quicker.

How it works

The tool searches the text from start to end for your exact characters. With Case sensitive off, upper and lower case are treated as equal. With Whole words only on, a match must not touch a letter, digit or underscore on either side. Each match is recorded with its position, which is turned into a line number and a column (both starting at 1). The search runs in your browser.

Worked examples

The first two examples use this two-line text: “Cat food. The cat sleeps.” then “Catalogue of cats.”

Whole words (default). Searching for “cat” finds “Cat” at line 1, column 1 and “cat” at line 1, column 15: Occurrences: 2, which is 25 per 100 words. “Catalogue” and “cats” are skipped.

Inside other words. Untick Whole words only and the count rises to 4. The new matches are in “Catalogue” and “cats”, and the table shows the third one as 3 | 2 | 1 | Cat: match 3, line 2, column 1.

Overlapping. Search “banana” for “ana” with Whole words only off. Without overlapping you get 1 match. With Count overlapping matches ticked, the second “ana” that shares the middle “a” is found too: Occurrences: 2.

Limits and tips

  • The Positions table lists the first 1,000 matches; the count itself goes far higher.
  • Line numbers count every line break, including blank lines, so they match what a text editor shows.
  • To count how often each different word repeats, try the Duplicate Word Finder.

Frequently asked questions

Why does it miss "cats" when I search for "cat"?
Whole words only is ticked by default, so "cat" must stand alone. Untick it to count "cat" inside "cats", "category" and "concatenate" too.
Can I count a phrase or a single character?
Yes. Type any phrase, such as "for example", or a single character such as a comma or the letter e. For single characters, untick Whole words only, because a letter inside a word is not a whole word.
What does "Count overlapping matches" change?
Normally, once a match is found the search continues after it. With overlapping on, the search restarts one character later, so "aa" is found 3 times in "aaaa" instead of 2.
Does a hyphen or apostrophe break a whole word?
Yes. Only letters, digits and the underscore count as part of a word, so a whole-word search for "mail" finds the "mail" in "e-mail" but not the one in "email".
Can I use wildcards or regular expressions?
No. What you type is matched literally, so a dot or asterisk means that exact character. For pattern searches and replacing, use the Find and Replace tool with its regular-expression option.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close