Skip to content

Line Counter

Paste text, a list or code to count its lines, empty lines and line lengths.

  • 100% free
  • Runs in your browser
  • Instant results
Quick answer

A line counter tells you how many lines a text contains. Paste your text and it reports the total number of lines, how many contain text and how many are empty, along with the longest, shortest and average line length, and the word and character totals. A line ends wherever there is a line break.

How to use the Line Counter

  1. Paste your textAdd a list, a block of code, a CSV export, a poem or any other text.
  2. Read the totalsThe total line count is shown first, followed by lines with text and empty lines.
  3. Check line lengthsSee which line is longest, the shortest line with text and the average length in characters.

What counts as a line

The line counter splits your text at line breaks, the invisible characters added when you press Enter. Each piece is one line, whether it holds a single word, a long paragraph or nothing at all. Windows, macOS and Linux store line breaks differently, and all three styles are recognised.

Two details explain most surprises:

  • Wrapped text is still one line. A paragraph that fills five rows on your screen is a single line if you never pressed Enter inside it. The count reflects line breaks in the text, not how wide the box is.
  • A final line break adds a line. If the text ends with a line break, there is an empty line after it. Code editors show the same thing as a blank last line. The "Lines with text" figure ignores it.

A line is counted as empty when it has no characters or only spaces and tabs. Line length is measured in visible characters, so an emoji or an accented letter counts once.

When a line count is useful

Counting lines is the quickest way to count the items in a list. If each line holds one email address, product code, URL or name, the number of lines with text is the number of items. That makes it easy to confirm that an export has the number of rows you expected, or that nothing was lost when you copied a list between programs. For a CSV file, remember to subtract one for the header row.

Writers use line counts for poems, lyrics, scripts and subtitles, where length is set in lines. Developers use them for a rough measure of a file or snippet, and the longest-line figure helps when a style guide caps lines at 80, 100 or 120 characters. Message and caption limits are sometimes set in lines too.

If the count is higher than expected, look for blank lines and duplicates: remove duplicate lines cleans both. To label each line with its number, use add line numbers. The text is counted in your browser and is never sent anywhere, and inputs of 100,000 characters or more are handled instantly.

Frequently asked questions

How do I count the number of lines in a text?

Paste the text into the line counter. The total number of lines appears immediately, together with the number of lines that contain text and the number that are empty.

Are empty lines included in the count?

The total includes them. "Lines with text" leaves them out, and "Empty lines" shows how many there are, so you can use whichever figure you need.

Why is the count different from the rows I see on screen?

Long lines wrap onto several rows on screen but are still one line. The count is based on line breaks, the places where Enter was pressed.

Can I use it to count items in a list?

Yes. With one item per line, the "Lines with text" figure is the number of items. Blank lines between items do not affect it.

How is line length measured?

In characters as you see them, including spaces inside the line. An emoji or an accented letter counts as one character.

Last updated 24 November 2026 by the TheTechFolk team.