WordsPolish.
← All Tools

Line Counter

Raw line counting for code, CSV, and list-style text — a different unit than sentences or paragraphs.

This tool runs entirely in your browser. Nothing you type or paste here is ever sent to a server — see how the calculations work.

A "line" here means exactly what it means in a code editor or a plain-text file: everything between one line-break character and the next, regardless of whether it forms a grammatical sentence or a complete thought. That makes this tool useful for content that isn't prose at all — source code, CSV rows, email address lists, keyword lists — where "sentence" and "paragraph" as units don't apply.

This is deliberately the most literal of the counting tools: it doesn't try to interpret meaning the way /sentence-counter/ or /paragraph-counter/ do. It counts line-break characters and reports the number of resulting lines, full stop.

Line count appears here as you type or paste.

0

Total lines

0

Non-empty lines

What counts as a line

Every line-break character (or line-break sequence — Windows text files use CRLF, Unix/Mac use just LF, and this tool normalizes both so line count is consistent regardless of which system the text originated on) starts a new line. A blank line still counts as one line, unlike the paragraph counter, which requires a blank line specifically to mark a boundary rather than counting it as content.

This distinction is exactly why line count and paragraph count diverge on the same text: a paragraph with three sentences that's been hard-wrapped across four lines (common in text copied from a PDF or terminal) reports as four lines but one paragraph. Conversely, a list of ten single-line bullet points with blank lines between each reports as roughly twenty lines but only ten paragraphs (each bullet plus its trailing blank line).

Also reported: the count of non-empty lines specifically, which is the more useful number for something like a pasted email list or keyword list where blank lines are just spacing noise you want to ignore.

Who uses this

  • Counting rows in a CSV or TSV export pasted as plain text, before importing it somewhere with a row limit.
  • Checking a pasted list of email addresses, URLs, or keywords for how many entries it actually contains.
  • Verifying line count in code snippets or config files pasted for review, distinct from word or character count.

Edge cases to know about

  • A file with a trailing newline at the very end (extremely common — most text editors add one automatically on save) doesn't get counted as an extra empty line at the end; the tool trims one single trailing line break before counting so the number matches what you'd see counting lines by eye in an editor.
  • Text with mixed line-ending styles (some CRLF, some LF — this can happen when combining text copied from Windows and Mac/Linux sources) is handled correctly because both are normalized before counting, but it's worth knowing the raw byte count of such a file would differ from what a byte-level tool reports.
  • A single very long line with no line breaks at all (like a minified JavaScript file or one giant unwrapped paragraph) counts as exactly one line, no matter how many characters it contains.

Related tools

FAQ

Is line count the same as paragraph count?
No. Paragraph count only increases on a genuinely blank line separating two blocks of text; line count increases on every single line break, including ones inside a hard-wrapped paragraph. Use /paragraph-counter/ for prose structure and this tool for literal line-by-line content like code or lists.
Does an empty line at the very end of my paste count?
A single trailing line break (the kind almost every text editor adds automatically when saving a file) is trimmed before counting, so it won't inflate your total by one. Multiple genuinely blank lines beyond that final one are still counted as lines.
Why would I use this instead of the word counter for a list?
Word count on a list of email addresses or URLs is close to meaningless — a single URL with no spaces counts as one "word" no matter how long it is. Line count tells you the actual number of entries, which is what you usually want when working with list-style data.