Skip to content

Line Counter

Count total, non-empty and unique lines in any list or file.

0

lines in total

Longest line

—

Quick Tool Overview

The Line Counter reports how many lines a block of text contains, along with how many are non-empty, how many are distinct, and which is the longest. It is the quickest way to check that an export, a log or a pasted list is the size you expected it to be.

What it does
Counts total, non-empty, unique and longest lines
You give it
A list, a log, a CSV or a block of code
You get back
Four counts and the longest line in full
Best for
Checking exports, logs, CSV rows and lines of code
Text Tools Free, unlimited use No sign-up Runs in your browser

About the Line Counter

A line count is the fastest sanity check there is on a pasted list. Did the export give you all 4,000 rows, or did it stop at 1,000? Did the copy from the terminal pick up the blank line at the end? This counter answers all of that at once rather than making you scroll to the bottom and read a row number.

Four figures are reported: total lines, lines that contain something other than whitespace, distinct lines once duplicates are collapsed, and the length of the longest line. That last one matters more than it sounds — it is usually how you find the one malformed row in a CSV that is breaking an import.

Key features of the Line Counter

Four counts, one paste

Total lines, non-empty lines, unique lines and the longest line length are reported together rather than one at a time.

Handles every line ending

Windows CRLF, Unix LF and old Mac CR are normalised first, so the same file gives the same count wherever it came from.

Trailing newline handled sensibly

A single newline at the end of a file is not counted as an extra empty line, which matches what wc -l and your editor report.

Finds the malformed row

The longest line is shown in full — usually the one row that is breaking a CSV import.

Duplicate detection built in

The unique count tells you immediately whether a list has repeats, without running it through a separate tool.

How to use the Line Counter

  1. 1

    Paste your lines

    Any list, log, CSV or block of code. Windows, Mac and Unix line endings are all handled.

  2. 2

    Read the four counts

    Total, non-empty, unique and longest-line figures appear together under the box.

  3. 3

    Ignore blanks if you need to

    Switch on "ignore empty lines" when trailing blank lines from a copy-paste are skewing the total.

  4. 4

    Check the longest line

    The longest line is shown in full, which is normally the row that is breaking your import.

Frequently asked questions

Both are normalised before counting. A CRLF pair from Windows counts as one line break, exactly as a lone LF from Unix or macOS does, so the same file gives the same count whichever system it came from.

Reviews of the Line Counter

What people who use the Line Counter think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Line Counter. It takes half a minute and no account.

Write the first review

More text tools