Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Generating a Count of Word Occurrences.
Written by Allen Wyatt (last updated May 9, 2026)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365
As you are analyzing your documents, you may wonder if there is a way to create a count of the number of times a certain word appears in the document. Unfortunately, Word doesn't include such a feature, but there are a couple of things you can do.
First, if you want to know the number of times a specific word or phrase is used, you can follow these steps:

Figure 1. The Replace tab of the Find and Replace dialog box.
This approach works great if you just have one or two words or phrases you want to know about. You can automate the process a bit by using a macro to search through the document and count for you. The following macro prompts the user for a word, and then counts the number of times that word appears in the document. It will continue to ask for another word until the user clicks on the Cancel button.
Sub FindWords()
Dim sResponse As String
Dim iCount As Integer
' Input different words until the user clicks cancel
Do
' Identify the word to count
sResponse = InputBox( _
Prompt:="What word do you want to count?", _
Title:="Count Words", Default:="")
If sResponse > "" Then
' Set the counter to zero for each loop
iCount = 0
Application.ScreenUpdating = False
With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
.Text = sResponse
' Loop until Word can no longer
' find the search string and
' count each instance
Do While .Execute
iCount = iCount + 1
Selection.MoveRight
Loop
End With
' show the number of occurences
MsgBox sResponse & " appears " & iCount & " times"
End With
Application.ScreenUpdating = True
End If
Loop While sResponse <> ""
End Sub
If you want to determine all the unique words in a document, along with how many times each of them appears in the document, then a different approach is needed. The following macro will do just that.
Sub WordFrequency()
Const maxwords = 5000 ' Maximum unique words allowed
Dim SingleWord As String ' Raw word pulled from doc
Dim Words(maxwords) As String ' Array to hold unique words
Dim Freq(maxwords) As Long ' Frequency counter for unique words
Dim WordNum As Long ' Number of unique words
Dim ByFreq As Boolean ' Flag for sorting order
Dim ttlwds As Long ' Total words in the document
Dim Excludes As String ' Words to be excluded
Dim Punctuation As String ' Punctuation marks
Dim ans As String ' How user wants to sort results
Dim Found As Boolean ' Temporary variables
Dim J As Long
Dim K As Long
Dim L As Long
Dim Temp As Long
Dim tword As String
Dim aword As Object
Dim tmpName As String
' Punctuation marks
Punctuation = ".,:;!?)}]'" & Chr(34) & ChrW(8221) & ChrW(8217)
' Excluded words
Excludes = "[the][a][of][is][to][for][by][be][and][are]"
Excludes = Excludes & "[but][or][because]"
' Find out how to sort
Do
ans = InputBox("Sort by WORD or by FREQ?", "Sort Order", "WORD")
ans = UCase(Trim(ans))
If ans = "" Then Exit Sub
Loop Until ans = "WORD" Or ans = "FREQ"
ByFreq = (ans = "FREQ")
Selection.HomeKey Unit:=wdStory
WordNum = 0
ttlwds = ActiveDocument.Words.Count
For Each aword In ActiveDocument.Words
If WordNum = maxwords Then
MsgBox "Too many words in document!", vbOKOnly
Exit For
Else
SingleWord = Trim(LCase(aword))
' Get rid of trailing punctuation
Do While (Len(SingleWord) > 0) And (InStr(Punctuation, Right(SingleWord, 1)) > 0)
SingleWord = Trim(Left(SingleWord, Len(SingleWord) - 1))
Loop
' Out of range?
If Left(SingleWord,1) < "a" Or Left(SingleWord,1) > "z" Then SingleWord = ""
' On exclude list?
If InStr(Excludes, "[" & SingleWord & "]") Then SingleWord = ""
If Len(SingleWord) > 0 Then
Found = False
For J = 1 To WordNum
If Words(J) = SingleWord Then
Freq(J) = Freq(J) + 1
Found = True
Exit For
End If
Next J
If Not Found Then
WordNum = WordNum + 1
Words(WordNum) = SingleWord
Freq(WordNum) = 1
End If
End If
End If
ttlwds = ttlwds - 1
StatusBar = "Remaining: " & ttlwds & ", Unique: " & WordNum
Next aword
' Sort it into order
For J = 1 To WordNum - 1
K = J
For L = J + 1 To WordNum
If (Not ByFreq And Words(L) < Words(K)) _
Or (ByFreq And Freq(L) > Freq(K)) Then K = L
Next L
If K <> J Then
tword = Words(J)
Words(J) = Words(K)
Words(K) = tword
Temp = Freq(J)
Freq(J) = Freq(K)
Freq(K) = Temp
End If
StatusBar = "Sorting: " & WordNum - J
Next J
StatusBar = False
' Write out the results
tmpName = ActiveDocument.AttachedTemplate.FullName
Documents.Add Template:=tmpName, NewTemplate:=False
Selection.ParagraphFormat.TabStops.ClearAll
With Selection
For J = 1 To WordNum
.TypeText Text:=Freq(J) & vbTab & Words(J) & vbCrLf
Next J
End With
MsgBox "Found " & WordNum & " unique words", vbOKOnly, "Finished"
End Sub
When you open a document and run this macro, you are asked if you want to create a list sorted by word or by frequency. If you choose word, then the resulting list is shown in alphabetical order. If you choose frequency, then the resulting list is in descending order based on how many times the word appeared in the document.
While the macro is running, the status bar indicates what is happening. Depending on the size of your document and the speed of your computer, the macro may take a while to complete. (I ran it with a 719-page document with over 349,000 words and it took about five minutes to complete on a relatively slow computer.)
The macro, as shown above, will handle up to 5,000 unique words. If you need more words, change the maxwords constant at the beginning of the macro. You can even change maxwords to a lower value if you desire, as it may make the macro run just a bit quicker.
Note that the macro checks for trailing punctuation marks on words. This is because the Words collection includes trailing punctuation marks with a word. Since it you wouldn't want variations like "final" (no period) and "final." (with a period), it is best to strip the punctuation marks out.
There are also lines in the macro that construct the Excludes string. This string contains words that the macro will ignore when putting together the word list. If you want to add words to the exclusion list, simply add them to the string, between [square brackets]. Also, make sure the exclusion words are in lowercase.
Finally, note that this macro will work correctly for documents written in English. It may not work for documents written in other languages, especially languages that are right-to-left. I'm sure similar macros could be devised for other languages, but I have no way to test them should I even undertake to write one.
If you don't like to use macros for some reason (or your company doesn't allow you to use them), there are other programs you can use to create word counts. For instance, the NoteTab text editor (the "light" version can be downloaded free at https://www.notetab.com/) includes a feature that provides a word count. All you need to do is copy your entire document and paste it into NoteTab. Then, within NoteTab, choose Tools | Text Statistics | More. It presents an analysis of the word frequency, including percentages.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10761) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Generating a Count of Word Occurrences.
Discover the Power of Microsoft Office This beginner-friendly guide reveals the expert tips and strategies you need to skyrocket your productivity and use Office 365 like a pro. Mastering software like Word, Excel, and PowerPoint is essential to be more efficient and advance your career. Simple lessons guide you through every step, providing the knowledge you need to get started. Check out Microsoft Office 365 For Beginners today!
Cross-referencing has long been a capability in Word documents. You can easily add and remove cross-references but ...
Discover MoreIn many offices, it is necessary to covert audio files (such as meeting recordings) into text. Some versions of Word have ...
Discover MoreGetting a word count for an entire document is easy. What you may not know is that some versions of Word can also provide ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2026-05-09 09:47:24
Arvilla Trag
The article on how to generate a count of word occurrences completely overlooked the fast and simple solution. Simply hit CTRL + F, enter the word you are searching for, and Word will tell you how many times it was found.
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2026 Sharon Parq Associates, Inc.
Comments