When to use it
Use this tool to count lines in any text: a list of email addresses, a CSV file, a log file, lines of code, poem lines or a list of names. It also shows how many lines are empty, how many are unique, and how long the longest line is, which helps when cleaning data or checking limits.
How to use it
- Paste text into Your text, or click Open text file to load a file from your device.
- Read the results:
- Total lines, including empty ones.
- Lines with text, ignoring empty lines.
- Empty lines.
- Unique lines, counting repeats only once.
- Longest line, in characters.
- Click Copy with line numbers to copy the text with numbered lines, or Clear to start again.
Worked example
You export a list of newsletter subscribers and paste it in. The tool shows 1,204 total lines, 1,198 lines with text, 6 empty lines and 1,150 unique lines. That tells you there are 48 duplicate addresses to remove before importing the list somewhere else.
A programmer pastes a function and sees the longest line is 132 characters, over the team’s 120-character limit, so they know a line needs wrapping.
What counts as a line?
A line ends wherever there is a line break, whether it came from Windows, Mac or Linux, since the tool understands all three styles. A line with only spaces counts as empty. A single line can be thousands of characters long, which is common in exported data or minified code.
Cleaning a list
For a messy list, check the counts here first, then tidy it up with Remove Duplicate Lines and Sort Lines. Running the counter again afterwards confirms that nothing important was lost along the way.
Tips
- Compare Lines with text and Unique lines. The difference is the number of duplicates.
- Use it before importing data. Many systems limit how many rows you can upload at once.
- Number lines for feedback. Sending numbered text makes it easy to say “see line 14”.
Common mistakes
- Counting wrapped lines as separate lines. A long line that wraps on screen is still one line. Only real line breaks start a new line.
- Forgetting the header row. In a CSV file, the first line is usually column names, not data.
- Expecting case-insensitive duplicates. Email addresses in different capitals count as different lines, so convert the list to lowercase first with the Case Converter if needed.