🔢Occurrence Counter

Count occurrences of a word or character

How occurrences are counted here

Use this when you want to know how often a phrase repeats in a draft, how many times an error string shows up in a log, or how frequently a keyword appears across survey answers. The search term is matched literally rather than as a regular expression, so dots, question marks and brackets are looked for exactly as typed instead of being treated as pattern syntax.

Three options change the answer significantly. Match case decides whether upper and lower case letters are treated as the same character. Overlapping matches decides whether aa inside aaa counts once or twice; if a result surprises you, check this setting first. Whole words only accepts a match when the characters immediately before and after it are not letters or digits, so searching for cat that way no longer matches the middle of concatenate.

Total length is measured in Unicode code points, so one emoji counts as a single character rather than two. The counting rules line repeats exactly which options were applied, and if the whole-word filter dropped any matches it reports how many were excluded. The table below lists the line numbers that contain matches, the count on each line and a short preview, which makes it easy to see whether the hits cluster in one place. Everything runs in your browser.

Frequently asked questions

How many times does aa appear in aaa?

Once with overlapping matches off, twice with it on. The option is off by default, and the counting rules line always states which way the count was made.

Can I use a regular expression?

No. The term is matched literally, so a dot or asterisk is searched for as that symbol. The upside is that a malformed pattern can never break the count.