Line Counter
Count the lines in any text instantly: total lines, non-empty lines, and characters. Free, private, in your browser.
How to use this tool
- Paste or type your text into the box above.
- Read the total, non-empty and blank line counts instantly.
- Use the character count to double-check length limits.
A line counter tells you how many lines a block of text contains — useful for checking file lengths, poetry and lyric formats, log excerpts, CSV row counts, or any limit expressed in lines rather than words. Paste your text and the total updates instantly; nothing you paste ever leaves your browser.
How it works
The Line Counter counts the number of lines in your text, where each newline character marks the end of a line. An empty line at the end of the text is not counted unless it contains at least one character.
Line counting is most useful for developers and data analysts working with code, log files, CSV data, or configuration files. Knowing the line count helps estimate file size, check whether a code file is getting too long, or verify that exported data has the expected number of rows.
For prose writers, line count can help check that a poem has the right number of lines or that an outline has the expected number of items.
Paste your content and the count appears instantly. For best results with code or data, paste the raw content without any surrounding formatting.
Worked example
Count rows in a CSV export to verify completeness
- Open your CSV file and copy all rows including the header.
- Paste into the Text field.
- Read the line count.
- Subtract 1 for the header row to get the data row count.
501 lines shown; subtract 1 header = 500 data rows as expected.
Common mistakes to avoid
- Pasting wrapped text from a word processor where visual line wraps are not real newlines — only hard line breaks are counted.
- Forgetting to account for a header row when counting data rows in a CSV.
- Assuming blank lines are not counted — they are, and they can significantly inflate the count in sparse documents.
Key terms
- Line
- A sequence of characters ending with a newline character or at the end of the file.
- Empty line
- A line that contains only a newline character, with no other content.
Frequently asked questions
- How is a line counted?
- Every line break (Enter/newline character) starts a new line, whether or not the line has content. Blank lines are counted separately so you can see both totals.
- Does it work for code?
- Yes — for source code you may also like our Lines of Code Counter, which separates code, comment and blank lines.