Text & String Utilities100% Client-Side

Count Total, Non-Empty, and Blank Lines

Paste a block of text to count its physical lines and see which lines contain content. The tool handles Unix and Windows line endings. A row with only spaces or tabs is counted as empty, and a final line break leaves an additional empty line at the end. This helps when checking a list, comparing text samples, or tracking blank rows in an export.

Input
23 chars•3 lines
Output

How to Use the Line Counter Online

  1. 1Paste the text with its original line breaks and leading or trailing blank rows.
  2. 2Read Total Lines to see every line position in the pasted value.
  3. 3Compare Non-Empty Lines and Empty Lines to distinguish records from spacing.
  4. 4Check whether the source ends with a newline when the result is one line higher than expected.

Input & Output Examples

The whitespace-only line and the empty position after the final newline both count as empty.

Input Sample
top
 	
bottom
Expected Output
Total Lines:     4
Non-Empty Lines: 2
Empty Lines:     2

One Windows line break splits the input into two non-empty lines.

Input Sample
first
second
Expected Output
Total Lines:     2
Non-Empty Lines: 2
Empty Lines:     0

Practical Developer Workflows

  • Check a plain-text import to see how many rows contain usable values.
  • Compare two versions of an export to find a change in blank-line totals.
  • Build a test fixture with a whitespace-only row and a trailing newline.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

The tool counts stored line breaks. A long line can wrap visually in a narrow panel while still counting as one line. Copying the text to another window width does not change the count by itself.

Explore Other Tools

12 suggested tools

View all tools