Line Counter

Paste a text, a poem or code to count lines, with the line count shown with and without blank lines.

A sample. Type or paste your own.

Sample: the counts of the text in grey above.

Lines
6
Lines with text
5
Words
22
Characters
121

More options a limit for lines

What the 4 counts mean

The line counts 2

  • Lines Every line the text holds, counted whether it is blank or not.
  • Lines with text Lines that hold something other than spaces and tabs: the sample’s 6 less its 1 blank line.

Counted beside them 2

  • Characters Everything in the box. A line break counts as 1 character, so the sample’s 5 breaks are 5 of its 121.
  • Words Stretches that hold a letter or a digit: 22 in the sample. A line break ends a word the way a space does.

How it works

This online line counter shows how many lines a text has, blank ones included, and how many of them hold text. The sample verse reads 6 lines, or 5 without the blank one.

Read the full guide

What counts as a line

A line ends where a line break was typed, not where a narrow screen wraps the words. A long paragraph typed without a break is 1 line. The last line counts without a break after it, and a break left at the very end adds one more.

How to count lines in a poem

Paste the poem, or any poetry, and read Lines with text, which leaves out the blank line between stanzas. A title counts as a line. The sample’s two stanzas hold 3 lines and 2.

Count lines of code

Lines is every line of the file, the empty ones included. Lines with text leaves those out and still counts a line that holds only a comment or a bracket.

Questions and answers

Does the line count include blank lines?

Lines does and Lines with text does not. A line that holds only spaces or tabs is blank. The gap between the two numbers is the number of blank lines.

Is it a new line counter too?

Nearly. New lines are one fewer than lines: the sample has 6 lines and 5 line breaks. A Windows line end, which is stored as two characters, counts as one break.

Is it a word and line counter?

Yes. Words and characters are counted beside the lines. They are totals for the whole text, not a number for each line.