Word count

Updated: 06/30/2019 by Computer Hope
word count

A word count is a numerical count of how many words a document contains. Most word processors today can count how many words are in a document for the user.

Word count example

In this sentence example, the word count is nine.

Ways to get a word count

Getting a word count in Microsoft Word

In Microsoft Word, the word count feature is found in the Tools menu or on the Review tab.

Note

If the status bar at the bottom of the screen is shown in Microsoft Word, it also shows the current word count in the document. If the status bar is shown but does not show the word count, right-click on the status bar and make sure that the Word count option has a check mark.

Count the words in WordPerfect

In Corel WordPerfect for Windows, the word count is located under Document information in the File menu.

Viewing the word count in Notepad++

In Notepad++, click View and then click Summary.

Viewing word count in TextPad

In TextPad, click View and then Document Properties or press the keyboard shortcut Alt+Enter.

Using an Internet site to count words

Many websites will count the number of words in your document. First, go to a word counting website, such as wordcounter.net. Next, copy and paste the text from the document and look near the bottom of the field for the word count.

An example of getting a word count in programming

In computer programming, there are many ways to get a word count of a variable or other text. Below is one example of how you could get a word count of a variable using Perl.

Tip

Some programming languages may have a function that can be used to give a word count.

use strict;
my $example = "Hello this is an example";
my @example = split(/ /, $example);
my $countwords = $#example + 1; print "There are $countwords words in '$example'.\n";

In the above example, we first define the "$example" variable with some generic text for an example. Next, we split that variable by spaces and add each word into an array. Once the words have been loaded into an array, we can count the elements of the array and add one to that count because the count starts as "0" and not "1".

There are 5 words in 'Hello this is an example'.

As mentioned earlier, this is one of dozens of different ways you could count the words in a file, variable, or other text. The above example, or any other method could also be made into a subroutine so it could be called throughout the script.

Viewing the word count of any text with online tools

  • Use our free online text tool to give a word count of any text.

Software terms, Tally, Word