Boneyard Tools

Count Occurrences of a Word or Phrase

Paste a block of text, type the word or phrase you want to find, and this tool reports how many times it appears along with the position of the first match. Three checkboxes let you ignore letter case, restrict to whole words, and allow overlapping matches so you can tune exactly what counts. Everything updates live as you type, with no button to press.

How to count occurrences

  1. Paste or type your text into the 'Your text' box.
  2. Enter the term to count in the 'Word or phrase to count' field.
  3. Tick 'Ignore case' to treat upper and lower case as the same.
  4. Tick 'Whole word only' to skip matches buried inside longer words.
  5. Tick 'Count overlapping' to let matches share characters, then read the Occurrences and First position cards.

Examples

Count a repeated word

Text "the cat sat on the mat", term "the"
2 occurrences, first position 0

Overlapping matches share letters

Text "aaaa", term "aa", Count overlapping on
3 occurrences, first position 0

Whole word only ignores substrings

Text "cat category scatter", term "cat", Whole word only on
1 occurrence, first position 0

Frequently asked questions

What does the Occurrences card show?

It shows the total number of matches found in your text using the current options. The neighbouring First position card shows the zero-based index of the first match, or a dash when there are no matches.

What does Whole word only do?

It counts the term only when it is not attached to other letters, digits or underscores. Searching cat with this on matches the standalone word cat but skips the cat inside category and scatter.

What is Count overlapping for?

It lets matches reuse characters. Searching aa in aaaa finds 3 overlapping matches at positions 0, 1 and 2, whereas the default non-overlapping count finds 2 separate matches at positions 0 and 2.

Can I count a whole phrase, not just one word?

Yes. The search field accepts any string including spaces and punctuation, so you can count a full phrase, a code token or a symbol wherever that exact sequence appears.

Is the count case sensitive by default?

Yes. Without any options, The, the and THE are counted separately. Tick Ignore case to fold them together so all three are counted as the same term.

What counts as a word boundary?

Any character that is not a letter, digit or underscore, including spaces, punctuation, and the start or end of the text. Whole word matching passes only when both sides of the term sit against such a boundary.

What happens if the search box is empty?

An empty term never matches anything, so the count stays at zero and a prompt invites you to type a word or phrase to start counting.

Is there a limit on how much text I can search?

There is no fixed cap. The search runs in your browser, so the practical limit is your device memory, and even large pastes are counted almost instantly as you type.

Does anything leave my browser?

No. The text and the term are processed entirely on your device with no upload, which keeps private documents and drafts confidential.

Learn more

Related tools