Line Counter — Free Online Text Tool
Line Counter — Count Lines in Text Online
Paste any text — a log file, a CSV export, a list of URLs, a code file — and click COUNT LINES to see how many non-empty lines it has. EMPTY LINES counts the blank ones. Everything runs in your browser; nothing you paste is uploaded.
What each button counts
| Button | Result | Details |
|---|---|---|
| COUNT LINES | Lines: N |
Lines that contain at least one non-whitespace character |
| EMPTY LINES | Empty lines: N |
Lines that are empty or contain only spaces and tabs |
| FULL STATS | Words: N and Lines: N |
Word count plus the non-empty line count |
So for this input:
first line
second line
third lineCOUNT LINES reports Lines: 3 and EMPTY LINES reports Empty lines: 2 — the second blank line contains only spaces, and still counts as empty.
Why "non-empty" lines?
Most of the time you want the number of records: rows in a CSV, entries in a list, hits in a log. A trailing newline at the end of a file, or blank separator lines between paragraphs, would inflate a raw count. Counting only lines with content gives the number you are usually after. If you need every physical line including blank ones, add the two results together.
This differs from wc -l, which counts newline characters: a file whose last line has no trailing newline reports one fewer line in wc -l, and blank lines are included.
Common uses
- Check a list before importing it — make sure a list of 500 email addresses really has 500 entries.
- Size a log excerpt — how many events are in the lines you copied from a terminal.
- Compare two exports — paste each into its own tab and compare the counts.
- Find stray blank lines — a non-zero EMPTY LINES result in a file that should have none.
More text tools on the same page
The other buttons work on the same input, so you can clean text and count it without switching tools:
- REMOVE DUPES / COUNT DUPES — deduplicate the list, then count again.
- SORT A-Z / SORT Z-A — sort lines alphabetically (blank lines are dropped).
- COUNT WORDS and COUNT CHARS — word and character totals.
- SPACE → NEWLINE — split a space-separated list into one item per line, then count the lines.
Privacy
Counting happens locally in your browser tab. Use the share button only if you want to send the text to someone: it encodes the input into the link.
Related tools
- Character Counter
- Duplicate Counter
- Sort Lines
- Text Diff — compare two versions line by line