Loading the interface. JavaScript is required; controls stay disabled until ready.
Paste or type the text you want to work with.
Run the tool to generate your result here.
Input and output are limited to 1,000,000 UTF-16 units. Line operations support up to 20,000 lines; Compare is limited to 250,000 line pairs. Results remain plain text in your browser.
How to count lines of text online
A line counter counts rows separated by actual line breaks, not the rows you happen to see on screen. Paste your text and select Count lines to see total, non-empty and blank lines. This is useful for a one-item-per-line list, a short log or a text export when you need an explicit row count.
Total lines, blank lines and non-empty lines
For non-empty input, the total is one plus the number of line separators. Empty input has zero lines. A line containing only spaces or tabs is blank; a line with any other content is non-empty. Non-empty lines plus blank lines equal the total. This count measures structure rather than meaning: a row containing punctuation still contains content.
A worked line-count example
Enter red, press Enter twice, then enter blue. The result is three total lines: two non-empty and one blank. If you press Enter again after blue, there are four total lines because the trailing line break creates an empty final row. That final blank row is easy to overlook when counting manually.
Why wrapped lines do not increase the count
A long sentence may fill several rows on a phone and fewer on a wide monitor. Those are visual wraps, not stored newlines. Resizing the editor does not change the line total. A page-layout question such as how many printed lines fit on a page also depends on margins, font size and spacing; this calculator does not estimate page layout.
Windows and Unix line endings
The counter recognizes CRLF, LF and CR as line separators. A Windows CRLF pair is one separator, not two. Pasting into a browser textarea can normalize line endings, so the result describes the text received by the tool rather than auditing an original file's bytes.
Count first, make any cleanup changes in a separate tool, then count again to confirm the effect. Text counting does not remove blank lines or duplicates. A CSV field may contain a quoted newline, so a physical text-line count is not necessarily the number of CSV records. Likewise, this is not a programming-language parser or a count of executable code statements.
Processing rules and steps
Empty input has zero lines. CRLF, LF and CR each separate lines; a trailing line break adds an empty final line, matching the existing counters. Lines containing only whitespace count as blank.
- Paste or type text into the labelled input.
- Select Count lines to see total, non-empty and blank lines; visual wrapping is not counted.
- Review the output, then copy it. Reset clears the current inputs and result.
Questions and answers
Do wrapped lines count separately?
No. Browser visual wrapping does not insert a newline and does not change the count.
Does a line counter count wrapped lines?
No. A line ends only where there is a line break. A long paragraph that wraps across five lines on screen still counts as one line, because wrapping depends on window width and font size. To check how text will wrap in print, view it at the final page size in your editor.
Why do I get one more line than I expected?
If the text ends with a line break, the counter sees an empty final line after it. Many code editors show the same thing as an extra numbered line. Delete the final line break if you want the count to match only the lines with content.
How can I count lines in a CSV or code file?
Open the file in a text editor, select all, copy and paste it here. For a CSV with a header row, subtract one from the total to get the number of data rows. Fields that contain line breaks inside quotes will increase the count, so check exports from spreadsheets carefully.
Choose your next task
- Remove duplicate lines: Remove repeated entries after checking how many rows you have.
- Text sorter: Order a newline-separated list without treating wrapped text as extra entries.
- Prefix and suffix tool: Add the same beginning or ending to each actual line.
- Character counter: Measure text length rather than the number of lines.
- Word and character counting guide: Understand why lines, paragraphs, words and characters give different totals.