Line Counter

Working with lists, logs or code? Our free Line Counter tells you how many lines your text has — total, non-empty and empty — plus the longest and average line lengths, all updated live as you type.

0
Total lines
0
Non-empty lines
0
Empty lines
0
Longest line
0
Avg length

Counts update live as you type. Everything runs in your browser — your text is never sent to a server.

How to Use

  1. Paste or type your text into the box — sample text is included to try.
  2. Put each item on its own line.
  3. Watch the total, non-empty and empty line counts update live.
  4. Check the longest and average line lengths for your text.
  5. Click Clear text to start over with an empty box.

Key Features

  • Counts total, non-empty and empty lines separately.
  • Shows the longest line and the average line length.
  • Live counts that update with every keystroke.
  • Sample text included so you can try it instantly.
  • 100% private — all counting happens in your browser.

FAQs

What counts as a line?

Every piece of text ending with a line break counts as one line — the counter simply counts line breaks plus one for the final line.

Do empty lines count towards the total?

Yes, empty lines are included in the total, but they are also reported separately so you can see how many of your lines actually contain text.

What about lines containing only spaces?

Lines with only whitespace are treated as empty lines, since they carry no content.

Is my text sent to a server?

No. The counter runs entirely in your browser with JavaScript, so your text never leaves your device.

What is average line length useful for?

It helps with code style limits (such as 80 or 120 characters per line), poetry formatting, and checking that list items are roughly even in length.

Related Tools

You may also like our Word Counter, Paragraph Counter and Remove Duplicate Lines.

Scroll to Top