Skip to content

Keyword Counter

Count a word or phrase in the text you paste. red red blue contains red 2 times. The match ignores letter case and does not overlap.

Result

Enter text and a keyword

How to Use

  1. 1 Paste the text and the keyword.
  2. 2 Read the count.
  3. 3 red red blue contains red 2 times.

Example Output

  • red red blue contains red 2 times.

About This Tool

The count is the number of times the keyword fits from left to right without overlapping itself.

Counting red in red red blue

Type red red blue in the text box and red in the keyword box. The headline reads 2. The label above the headline reads Count. The sentence under the headline reads: The keyword appears 2 times. The labeled line is Count 2. That number is the whole result. The page searches the characters from left to right, ignores letter case, and starts the next search at the character after each match. In the sample the first red is a match. The search resumes on the space that follows those three letters. The second red is a match. The letters blue are not the letters red, so the search ends. The count is 2.

The count ignores letter case, so Red, RED, and red are the same three letters. The count does not overlap. After a match, the next search begins at the first character past that match, not one character later. A keyword of red red inside the text red red red matches once. The first match consumes the first two copies of red and the space between them. The last red is shorter than the keyword, so it does not add a second match. The sentence then reads: The keyword appears 1 time. The same step is easy to see with aa inside aaa. The first two letters match, the search resumes at the third letter, and one letter is not aa, so the headline is 1.

The text must be from 1 to 20000 characters. A text that is empty after the ends are trimmed, or longer than 20000 characters, is refused with Enter from 1 to 20000 characters. The keyword is trimmed, and then it must be from 1 to 80 characters. An empty keyword, or a keyword longer than 80 characters, is refused with Enter a keyword from 1 to 80 characters. Those refusals appear before any count. A count of 0 is a real result. If the text is blue and the keyword is red, the headline is 0 and the sentence reads: The keyword appears 0 times. The button says Count the keyword. Before you submit, the waiting line is Enter text and a keyword. Reset puts red red blue back in the text box and red back in the keyword box.

This page searches the characters you typed. It does not crawl a site, open a file, or split the paste into words before it looks. A space is a character. The keyword red does not match the letters r, e, and d when spaces sit between them. The keyword red does match the first three letters of reddish, because those letters sit together, and the sentence reads: The keyword appears 1 time. The page does not store the text. Copy result copies the sentence with the count. Keep that sentence with the text and the keyword if you need a record of the 2.

What the Count Measures

A match is a run of characters equal to the keyword, after both sides are lowercased. The page uses the text as typed, including spaces in the middle. It trims the keyword only. A keyword typed with spaces at the ends is searched without those end spaces. A keyword of red with a space on either side still searches for red. The text is not trimmed before the search. A space at the start of red red blue does not hide the two matches, and that space does count toward the 20000 character limit. The search then walks forward. Each time the keyword is found, the count grows by one and the next start position moves by the full length of the keyword.

How red red blue Becomes 2

The sample text is red red blue and the keyword is red. Lowercase does not change either side. The page looks at the first character. The letters red sit there, so the count becomes 1 and the next search starts after that red. A space, then red, then a space, then blue remain. The next red matches, the count becomes 2, and the search resumes on the following space. The letters blue do not contain red. The headline is 2. You can do the same check with a finger: cover the first red, cover the second red, and stop when blue is left. Two covers, one keyword length each, and no overlap between the covers.

A whole-word percent is a different reading of a paste. The Keyword Density Checker splits text into words, counts ordered whole-word hits, and divides those hits by the word count. In cat cat dog, the keyword cat is 2 of 3 words, which is 66.6666666667 percent. catalog does not match cat there, because catalog is one word. This page would count the letters red at the start of reddish, because it searches characters and does not require a word boundary. Use the density checker when you want matches over words and that percent. Use this page when you want the non-overlapping character count, which is 2 for red in red red blue.

Text the Counter Will Not Fetch

A URL typed into the text box is characters. If those characters contain the keyword, they count. If they do not, the count can be 0. The page does not open the URL, follow a link, or read a second page. HTML typed into the box is also characters. The letters inside a tag count when they match the keyword. The page does not strip tags for you. If you meant the words a reader sees, paste those words. If you meant the markup itself, paste the markup and accept that its letters are part of the search. The page does not store either paste.

Counts You Can Recompute

Start from the sample and confirm the headline 2, the sentence The keyword appears 2 times, and the line Count 2. Change the text to Red RED blue and leave the keyword as red. Letter case is ignored, so the headline stays 2. Change the text to blue and confirm the headline 0 and the sentence The keyword appears 0 times. Change the text to reddish and confirm 1 time. Change the text to red red red and the keyword to red red. The first match takes the first two copies, the last red is left over, and the headline is 1. Change the text to aaa and the keyword to aa. The headline is 1, because the search does not overlap. Change the keyword back to red and the text back to red red blue. The headline returns to 2.

Character length is a different limit from this count. The Meta Description Length Checker counts the characters in a description against a limit of 160. Hello is 5 characters, with 155 remaining. It does not search for a keyword, and it does not publish the description. A short keyword can still be a large count if the paste repeats it, and a long description can contain the keyword once. Use that checker when the question is how many characters you have typed against 160. Use this page when the question is how many non-overlapping times red fits in red red blue.

Limits of a Character Search

The count describes one text and one keyword. It does not describe a site, a folder, or a series of drafts. It does not stem words. reddish contains red as characters, and the page reports that. It does not also know that you might have wanted a whole word. It does not skip letters inside punctuation. The keyword red matches inside red, because the three letters sit together before the comma. If you wanted the comma to block the match, the keyword would have to include the comma, or you would need a different tool that splits words. This page will not invent that split.

Mistakes That Change the 2

The common miss is to expect a whole word. red inside reddish is 1 on this page. Another miss is to expect overlap. aa inside aaa is 1, not 2. Another miss is to leave spaces inside the keyword. The keyword r e d, with spaces, does not match red, because the space is part of the keyword after the ends are trimmed. Spaces at the very ends of the keyword are removed. Spaces in the middle stay. Another miss is to read a refusal as a zero. Enter from 1 to 20000 characters and Enter a keyword from 1 to 80 characters mean there is no count to record. A headline of 0 means the search ran and found nothing. Another miss is to change only the case and expect a new count. Red and red are the same search.

A count is not a reading time. The Reading Time Calculator divides a word count you type by a pace you type. 400 words at 200 words per minute is 2 minutes. It does not read a file, and it does not search a paste for the letters red. The 2 on this page is two matches. The 2 on that page is two minutes. Use the reading time calculator when you already know how many words you have and how fast a reader moves. Use this page when you still need to know that red fits in red red blue twice.

Using the Count on a Paste

Paste the text you mean to measure, type the keyword you mean to find, and read the headline with the sentence. The headline 2 is useful only next to those two fields. If the number surprises you, check three things in order. First, letter case does not matter, so do not spend time lowercasing the paste. Second, the search does not overlap, so a repeated keyword can be smaller than a glance suggests. Third, the search is characters, so a keyword can match inside a longer word. Change the keyword and count again. Each submit replaces the result. The page does not keep a table of earlier keywords.

Reading Count 2

Read the sample in this order. The headline is 2. The label is Count. The sentence is The keyword appears 2 times. The line repeats Count 2. The steps are compare without letter case, count non-overlapping matches from left to right, and show that count. If you recompute the sample by marking each red and moving past it, you land on the same 2. Read a one-match result the same way: headline 1, sentence The keyword appears 1 time, line Count 1. Read a zero the same way, with times. A refusal is not one of those rows. Write down the error, fix the field, and count again. Copy result copies the sentence, so paste the keyword beside it in your notes. The sentence says the keyword without repeating the letters red.

Line order is a different record from a character count. The Alphabetical Sorter sorts one item per line from A to Z. banana, apple, and cherry become apple, banana, and cherry. The sort ignores letter case when it compares, and it keeps the spelling you typed. It asks for 2 to 100 lines. It does not search those lines for a keyword, and it does not change the spelling to hide a match. Use it when the job is to order lines. Use the Count line here when the job is to record that red appears 2 times in red red blue.

What the Count Does Not Decide

The count does not decide whether the draft is finished, whether a reader will notice the word, or whether a search system will treat the page a certain way. It decides how many times the keyword fits from left to right without overlapping itself. You chose the text. You chose the keyword. The page lowercased both, searched characters, and stepped forward by the keyword length. If you include a heading in the paste, its letters join the search. If you leave the heading out, they do not. The page cannot know which choice matches the draft you had in mind.

Checks on the Sample Count

Count the sample and confirm headline 2, sentence The keyword appears 2 times, and line Count 2. Change red to RED in the text and count again. The 2 should not move. Change the text to reddish and confirm 1 time. Change the text to red red red and the keyword to red red and confirm 1 time. Change the text to aaa and the keyword to aa and confirm 1 time. Change the text to blue and confirm 0 times. Clear the text and confirm Enter from 1 to 20000 characters. Clear the keyword and confirm Enter a keyword from 1 to 80 characters. Put the sample back with Reset and count once more so 2 is the last headline.

Cleaning spaces is a different edit from this search. The Text Cleaner trims the ends and folds repeated spaces, tabs, and line breaks into one space. Hello followed by three spaces and world becomes Hello world. The headline there is the character count of the cleaned text, which is 11, and the lines show Characters in and Characters out. It does not store the text, and it does not count a keyword. Use it when the paste has extra whitespace you want folded before you read the words. Use this page when the whitespace is part of the text you meant to search, and the result you want is still the 2 for red.

Frequently Asked Questions

What is red in red red blue?

The count is 2. The headline is 2, the sentence is The keyword appears 2 times, and the line is Count 2. The search ignores letter case and does not overlap.

Does letter case change the count?

No. Red, RED, and red match the keyword red. The page lowercases the text and the keyword before it compares characters. Red RED blue with the keyword red is still 2.

Does the count overlap?

No. After a match, the next search starts at the character past the keyword. aa inside aaa is 1. red red inside red red red is 1. The page does not step back one character.

Does red match inside reddish?

Yes. This page searches characters, not whole words. reddish contains red at the start, so the sentence reads The keyword appears 1 time.

What if the keyword is missing?

The headline is 0 and the sentence reads The keyword appears 0 times. A count of 0 means the search ran. An empty text or an empty keyword is refused before a count.

How long can the text and keyword be?

The text is 1 to 20000 characters. The keyword is 1 to 80 characters after trimming. Longer or empty values are refused with Enter from 1 to 20000 characters or Enter a keyword from 1 to 80 characters.

Does the page open a site or a file?

No. It counts the text in the box. A URL in the box is characters, not a page the tool opens. The page does not store the paste.

What does Copy result copy?

It copies the sentence, such as The keyword appears 2 times. Write the keyword beside that sentence in your notes, because the sentence does not repeat the letters red. Reset restores red red blue and red.