Count number of lines in word file

Show word count

Word counts the number of words in a document while you type. Word also counts pages, paragraphs, lines, and characters.

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

When you need to know how many words, pages, characters, paragraphs, or lines are in a document, check the status bar.


Partial word count

For a partial word count, select the words you want to count. The status bar shows the word count for that selection and for the entire document.

Tip: Find the number of characters, paragraphs, and lines by clicking on the word count in the status bar.
Word count detail

Count the number of characters, lines, and paragraphs

You can view the number of characters, lines, paragraphs, and other information in your Word for Mac, by clicking the word count in the status bar to open the Word Count box. Unless you have selected some text, Word counts all text in the document, as well as the characters, and displays them in the Word Count box as the Statistics.

Word count dialog box

Count the number of words in a part of a document

To count the number of words in only part of your document, select the text you want to count. Then on the Tools menu, click Word Count.

Just like the Word desktop program, Word for the web counts words while you type.

Word Count

If you don’t see the word count at the bottom of the window, make sure you’re in Editing view (click Edit Document > Edit in Word for the web).

Click the word count to switch it off and on.

Word Count Disabled

Maybe you noticed that Word for the web gives you an approximate word count. That’s because it doesn’t count words in areas like text boxes, headers, footers, and SmartArt graphics. If you need an exact count, click Open in Word, and look at the word count at the bottom of the Word document window.

Need more help?

View Word Count in Microsoft Word Documents

by Avantix Learning Team | Updated May 10, 2022

Applies to: Microsoft® Word® 2013, 2016, 2019, 2021 or 365 (Windows)

You can view word count in Word documents in several ways. Although word count is typically displayed in the Status Bar, you can view a Word Count dialog box which can be displayed using the Ribbon, the Status Bar or a keyboard shortcut. The Word counter will check a document for the number of characters, lines, paragraphs and pages. Word count and other statistics are also available in Word Properties.

The Word Count dialog box shows the number of pages, words, characters (with and without spaces), paragraphs and lines in your document. The dialog box displays counts for the current selection.

Recommended article: How to Quickly Remove Hard Returns in Word Documents

Do you want to learn more about Microsoft Word? Check out our virtual classroom or in-person Word courses >

To select the entire document, press Ctrl + A (although total count appears if you simply click in text). You can also triple-click in a paragraph or click at the beginning of a selection and Shift-click at the end of a selection. If you want to select non-adjacent or non-contiguous sections of text, press Ctrl and drag over areas of text. There are many other great ways to quickly select text in Word. Check out the article 14+ Word Selection Shortcuts to Quickly Select Text.

Note that screenshots in this article are from Word 365 but are very similar in Word 2013, 2016 and 2019.

The Word Count dialog box appears as follows (depending on the selection):

Word count dialog box in Microsoft Word to view word, character, page and paragraph count.

In the Word Count dialog box, you can turn a check box off or on to include text boxes, footnotes and endnotes in the word count. This is typically left unchecked. The number of lines in the Word Count dialog box represents the number of lines with characters, not the number of sentences. The number of lines in a document will be affected by formatting such as font size and indents.

Vword count in the Status Bar

When you select text, word count for the selected text should appear in the Status Bar on the bottom left of your screen automatically:

View Word count in status bar in a MIcrosoft Word document.

If no text is selected, the count shows the total for the entire document.

If you double-click the word count in the Status Bar, the Word Count dialog box appears.

Although word count typically displays by default in the Status Bar, you can choose options to display. If you right-click in the Status Bar, a pop-up menu appears. If Word Count has been deselected in this menu, it will not appear in the Status Bar.

Check word count using the Ribbon

To check word count using the Ribbon:

  1. Click the Review tab in the Ribbon.
  2. Click Word Count in the Proofing group. The Word Count dialog box appears.
  3. Click Close.

Word Count appears on the Review tab in the Ribbon:

View Word count in the Proofing group on the Review tab in the Ribbon in MIcrosoft Word.

Check word count using a keyboard shortcut

You can also display the Word Count dialog box by pressing Ctrl + Shift + G.

View word count in document statistics

Word, character, line, paragraph and page count can also be viewed in document statistics or Properties.

To view word count in document statistics or Properties:

  1. Open the Word file.
  2. Click the File tab in the Ribbon.
  3. Select Info.
  4. In the area on the right, under Properties, several statistics appear including word count.
  5. To view more information, click Properties. A drop-down menu appears.
  6. Select Advanced Properties. A dialog box appears.
  7. Click the Statistics tab to view statistics.
  8. Click OK.

When you click File and then Info, statistics appear on the right side of the dialog below Properties:

Document properties in Word to view word count and page count.

The statistics that appear in this area and in the Advanced Properties are for the entire document, not the selected text.

Subscribe to get more articles like this one

Did you find this article helpful? If you would like to receive new articles, JOIN our email list.

More resources

How to Hide Comments in Word (or Display Them)

How to Superscipt or Subscript in Word (with Shortcuts)

How to Insert or Type the Sigma Symbol in Word (Σ or σ)

How to Insert the Not Equal Sign in Word (5 Ways to Type or Insert ≠)

How to Insert a Check Mark in Word (5 Ways to Insert a Check or Tick Mark with Shortcuts)

Related courses

Microsoft Word: Intermediate / Advanced

Microsoft Excel: Intermediate / Advanced

Microsoft PowerPoint: Intermediate / Advanced

Microsoft Word: Long Documents Master Class

Microsoft Word: Styles, Templates and Tables of Contents

Microsoft Word: Designing Dynamic Word Documents Using Fields

VIEW MORE COURSES >

Our instructor-led courses are delivered in virtual classroom format or at our downtown Toronto location at 18 King Street East, Suite 1400, Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at info@avantixlearning.ca if you’d like to arrange custom instructor-led virtual classroom or onsite training on a date that’s convenient for you.

Copyright 2023 Avantix® Learning

Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.

Avantix Learning |18 King Street East, Suite 1400, Toronto, Ontario, Canada M5C 1C4 | Contact us at info@avantixlearning.ca

Word includes a tool that allows you to view simple statistics about your document. These statistics include how many pages, words, characters, paragraphs, and lines are in your document. This is useful if you have to follow certain guidelines when writing your document.

To view these statistics, open the document in question and click the “Review” tab.

In the “Proofing” section, click “Word Count”.

The “Word Count” dialog box displays, as shown in the image at the beginning of this document. The number of pages and words can also be viewed on the status bar at the bottom of the Word window.

NOTE: The number of pages is only visible on the status bar when you are viewing your document in “Print Layout” view or “Draft” view (using the “View” tab).

If you don’t see the number of pages and words on the status bar, right-click on the status bar and select the items you want to view from the popup menu. Note that you can also view the line number for the line where the cursor is currently located.

The number of lines and pages may vary, depending on several factors, such as the margins in your document, the font and font size, and paragraph spacing, to name a few. For example, if you change to a smaller font size, there will be fewer lines and pages in your document than there would be with a larger font size. Even different printer drivers can result in a slightly different rendering of a font, thereby changing the number of lines and pages in your document.

Hidden text can also affect the line count reported on the “Word Count” dialog box. If the option to print hidden text is turned of, Word doesn’t count hidden text in the line count. If you want hidden text included in the line count, make sure you configure Word to print hidden text.

READ NEXT

  • › How to Count Characters in Word
  • › How to Get Workbook Statistics in Microsoft Excel
  • › How to Get a Paragraph Count for a Specific Paragraph Style in a Word Document
  • › How to Count Characters in Microsoft Excel
  • › How to Check the Word Count in Microsoft Word
  • › This New Google TV Streaming Device Costs Just $20
  • › Google Chrome Is Getting Faster
  • › BLUETTI Slashed Hundreds off Its Best Power Stations for Easter Sale

How-To Geek is where you turn when you want experts to explain technology. Since we launched in 2006, our articles have been read billions of times. Want to know more?

I don’t want it to delete the rest or anything but just to quickly report the number of lines the text I just entered is included.

How can I quickly find «the number of lines in this text that include the string I just entered»?

DavidPostill's user avatar

DavidPostill

150k77 gold badges348 silver badges386 bronze badges

asked Apr 3, 2012 at 7:42

j riv's user avatar

2

In notepad, you can type Ctrl+g to view current line number.
It also at bottom-right corner of status-bar.

answered Apr 3, 2012 at 9:51

kev's user avatar

kevkev

12.3k12 gold badges58 silver badges71 bronze badges

2

This can be done natively in Windows, using the command prompt:

find /c "string to find" "mytextfile.txt"

findstr is more advanced (supports regex) but doesn’t support printing line count. You could pipe its output to find:

findstr "string to find" "mytextfile.txt" | find /c /v ""

find /c /v means count lines not containing. From testing, the empty string to find ("") never actually occurs in the piped input from findstr, so its a safe value to use.

answered May 8, 2012 at 14:18

Bob's user avatar

BobBob

60.4k24 gold badges189 silver badges215 bronze badges

I found the best option was a cat text |grep text|wc -l with an msys installation.

answered May 8, 2012 at 14:07

j riv's user avatar

j rivj riv

2,4369 gold badges38 silver badges43 bronze badges

2

If you copy and paste the text into word you can see the Words, Characters (with and without spaces), Paragraphs and Lines by clicking on the bottom left where it shows the word count preview.

answered Nov 22, 2021 at 20:23

user1642742's user avatar

1

You are here: Home / Linux Tips / Count Files / How to Count the Number of lines, Words, and, Characters in a Text File from Terminal?

word count in termimal
word count in termimal

How can we get the number of lines or number of words in a file? The most easiest way to count the number of lines, words, and characters in text file is to use the Linux command “wc” in terminal.

The command “wc” basically means “word count” and with different optional parameters one can use it to count the number of lines, words, and characters in a text file.

To count the number of lines, use “wc” with “l” as

wc -l yourTextFile

To count the number of words, use “wc” with “w” option as

wc -w yourTextFile

And to count the total number of characters, use “wc” with “c” as

wc -m yourTextFile

Using wc with no options will get you the counts of bytes, lines, and words (-c, -l and -w option).

>wc file1.txt 
 1065    5343   40559 file1.txt

Count words, characters, and lines in multiple files

wc command can take multiple files at the same time and give you the number of words, characters, and lines. To get counts from multiple files, you simply name the files with space between them. Also it will get you the total counts. For example, to count the number of characters (-m), words (w) and lines (-l) in each of the files file1.txt and file2.txt and the totals for both, we would simply use

>wc -mlw file1.txt file2.txt

We would get the results in a nice tabular form

1065    5343   40454 file1.txt
 296    1075   11745 file2.txt
1361    6418   52199 total

How to Count a Certain Type of Files in a Directory?

One can also cleverly use the “wc” command on terminal and find the number of files (or files of certain type) in a directory. For example, to find the number of pdf files in a directory

ls -l *.pdf | wc -l

And remember that the first line of “ls -l” statement is a description. Therefore, the total number of pdf files is one less than the result of “ls -l *.pdf | wc -l“.

We just saw an example of using pipe operator “|” to count files. Here we fed the output of command “ls -l *.pdf” to “wc”. Or ability to piping (or chaining) multiple commands is a hallmark of Linux. We can do the same to numerous scenarios. For example, if we want to count all users who have currently logged on, we can do

who | wc -l

How to get the number of lines matching a pattern in a file?

If you want to count the number of lines matching a string pattern in a text file, the “grep” command with the option “-c’ comes in really handy.

less my_text_file.txt | grep -c "pattern"

or we can directly apply “grep” on the file like

grep -c "pattern" my_text_file.txt

Понравилась статья? Поделить с друзьями:
  • Count not sum in excel
  • Count no of sheets in excel
  • Count no of rows in excel worksheet
  • Count no of item in excel
  • Count names in excel sheet