Boneyard Tools

Substring counting versus whole-word counting

How the same search term can return different totals depending on whether you count raw substrings or only whole words, with worked examples.

The difference in one example

A substring count finds the term anywhere it appears, even inside a longer word. Searching cat as a substring in the text cat category scatter finds three matches, because cat also hides inside category and scatter. Switching on whole-word matching drops that to one, since only the standalone cat sits between real word boundaries. Knowing which mode you are in prevents surprising totals when your term is a short, common letter run.

When you want raw substring counts

Substring counting is the right choice when the characters themselves matter rather than the words they form. It suits counting file extensions, checking how often a delimiter or tag appears, tallying a repeated code snippet, or measuring a character pattern in DNA or log data. In these cases a match inside a longer token is still a genuine hit that you want included in the total.

When whole-word matching is safer

Whole-word matching shines for natural language tasks like counting how many times a name, keyword or filler word appears in an essay. Without it, searching is inflates its count with words like this, history and basis. The tool defines a word boundary as anything that is not a letter, digit or underscore, so punctuation and spaces both close a word. That makes the count line up with what a human reader would tally by hand.

Layering case and overlap on top

The three options combine freely. Ignore case widens matching so The and the count together, which is useful at the start of sentences. Count overlapping matters only for self-repeating patterns, where aa inside aaaa can be read as either two or three matches depending on whether matches may share letters. Start with the plainest search, then add one option at a time and watch the Occurrences card change so you understand what each toggle did.

Frequently asked questions

Why does my word count seem too high?

The default mode counts substrings, so a short term can match inside longer words. Turn on Whole word only to count just standalone occurrences and the total usually drops.

Does overlapping change a normal word count?

Rarely. Overlapping only affects terms whose own characters repeat, such as aa or ana. For ordinary words the overlapping and non-overlapping counts are identical.