Skip to content

Line counter

Paste a list, a log file or any text to count its lines, blank lines, sentences and paragraphs, and find the length of the longest line.

  • Free, no limits
  • No sign-up
Everything happens in your browser; your data is never uploaded.
  • ✓ Free
  • ✓ No sign-up
  • ✓ Nothing uploaded

Next step

What to do next

How to use it

  1. Paste or type your text or list.
  2. Read the line counts: total, non-empty and empty.
  3. Check sentences, paragraphs and words below.
  4. Edit the text; the numbers update as you go.
Try it now

What gets counted

The line counter shows eight numbers for whatever you paste:

  • Total lines – every line, including blank ones.
  • Non-empty lines – lines with at least one visible character.
  • Empty lines – blank lines and lines that contain only spaces or tabs.
  • Sentences and paragraphs (paragraphs are separated by a blank line).
  • Words and characters.
  • Longest line – its length in characters.

A line is whatever sits between two line breaks. Windows (CRLF), Mac and Linux (LF) line endings are all recognized. A final line break at the very end of the text starts a new, empty last line, the same way most code editors count it.

The count runs in your browser, so you can safely paste logs, customer lists or code.

When counting lines is useful

  • Lists and spreadsheets. Before importing a list of email addresses or product codes, check how many entries you have. The non-empty count tells you the real number of items even if there are blank lines in between.
  • Log files. See how many entries a log excerpt has, or compare two exports quickly.
  • Code. Get a rough line count of a snippet, and spot overly long lines (many style guides suggest staying under 80 or 100 characters).
  • Poems and lyrics. Count lines and stanzas; stanzas separated by a blank line show up as paragraphs.
  • Subtitles and form fields. Some systems limit the number of lines or the characters per line.

If the list has duplicates, clean it first with remove duplicate lines; for stray blank lines, use remove empty lines.

Lines vs. sentences vs. paragraphs

These three numbers often confuse people, so here is the difference:

UnitHow it is recognized
LineEnds with a line break (Enter)
SentenceEnds with . ! ? or … followed by a space and a capital letter or number
ParagraphA block of text separated from the next by at least one blank line

Text copied from a PDF often has a line break at the end of every visual line, so it shows many lines but few sentences. To turn those broken lines back into normal paragraphs, use remove line breaks.

The sentence count is an estimate: abbreviations such as Mr., U.S. or etc. followed by a capitalized word can be read as a sentence ending.

Tips for accurate counts

  • Trailing blank lines at the end of a paste add to the total but not to the non-empty count. Use the non-empty number when you need the number of items.
  • Lines with only spaces count as empty here, which is usually what you want for lists.
  • Wrapped lines in the text box are not new lines. Only real line breaks count, no matter how narrow the box is on your screen.
  • For word and character totals with reading time, the word counter gives a fuller breakdown.

Frequently asked questions

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

Paste the text into the box. The tool shows the total number of lines, plus separate counts for non-empty and empty lines.

Are blank lines counted?

They are included in the total and shown separately as empty lines. Lines that contain only spaces or tabs also count as empty.

Why is my line count one higher than expected?

If the text ends with a line break, the empty line after it counts as a line. The non-empty line count ignores it.

Does it count wrapped lines?

No. Only real line breaks start a new line. Text that wraps because the box is narrow is still one line.

Can I count lines in a large file?

Yes. Paste up to several megabytes of text; everything is processed locally in your browser.

Last updated: November 12, 2026

Recommended

Similar tools

If Line counter helped, you may need these too.

See all in category →

People also use