● Text Tools

Line Counter

Paste text, code, CSV rows or log output below to count total lines, blank lines and duplicates — updated instantly, with nothing ever leaving your browser.

Total Lines
Non-empty
Blank Lines
Words
Characters
Avg Chars/Line
Longest line
Duplicate lines
Unique lines

Line-by-line breakdown

Every line, numbered like a code editor. Duplicate lines are highlighted in red and marked with a "dup" badge.

Start typing above to see each line listed here.

Line length distribution

A quick view of how your line lengths spread out — useful for spotting overly long lines in code or CSV exports.

Short (<40 ch)
Medium (40–80 ch)
Long (>80 ch)

Start typing above to see your line length distribution.

Every feature, at a glance

Everything this line counter does, in one place.

Real-time line counting

Counts lines the moment you type or paste — no button to click, no page reload.

Blank vs. non-empty lines

See exactly how many lines are blank versus how many contain actual content.

Duplicate line detection

Every repeated line is flagged and highlighted, with a toggle to ignore letter case.

Longest line & average length

Instantly spot your longest line and see the average characters per line.

Line length distribution

A short / medium / long breakdown of every line, handy for code and CSV review.

#

Numbered line-by-line view

A code-editor-style gutter numbers every line so you can reference any one directly.

Aa

Case-insensitive matching

Toggle duplicate detection to ignore capitalization when it shouldn't count as a difference.

W

Word & character counts

Total words and characters are calculated alongside your line count.

Copy, clear & download

Copy your text to the clipboard, clear the box, or download it as a plain .txt file in one click.

🔒

100% private

All counting happens locally in your browser. Nothing you type is ever uploaded or stored.

Free & unlimited

No signup, no paywall, no daily limit — use it as many times as you like.

Works with any plain text

Handles source code, CSV rows, log files, subtitles, and poetry equally well.

What is a line counter?

A line counter is a text-analysis tool that counts every line break in a piece of text, including blank lines, and reports supporting stats like non-empty line count, longest line, and duplicate lines. This one runs entirely as JavaScript inside your browser — there's no upload and no server round-trip, so your file never leaves your device. Every count updates live as you type or paste.

How lines are counted

The tool splits your text on every line break and counts the resulting segments, including empty ones. This mirrors the Unix wc -l convention and how code editors display line numbers: a block of text with 10 line breaks contains 11 lines. Blank lines — including trailing blank lines at the end of a file — are counted the same way.

How duplicate lines are detected

A line is flagged as a duplicate if the same trimmed text appears more than once anywhere in your input. This is useful for finding repeated rows in a CSV export, redundant entries in a config file, or copy-pasted lines in a script. Turn on "Ignore case" if capitalization shouldn't count as a difference — for example, when comparing usernames or tags.

Who uses a line counter

  • Developers — count lines of code, check file size limits, or estimate effort for a code review.
  • Data analysts — count rows in a CSV or TSV export before importing it elsewhere.
  • Sysadmins — scan log files for line counts and spot repeated error lines.
  • Writers & poets — count lines in poetry, scripts, or lyrics where line breaks carry meaning.
  • Subtitle editors — check subtitle or caption files where each line has a strict length limit.

Common line-count use cases

Use caseWhat line count tells you
Source code filesRough size/complexity of a file (lines of code)
CSV / TSV exportsNumber of data rows, often minus a header line
Log filesNumber of log entries, and how many are duplicated
Subtitle (.srt) filesNumber of caption blocks and per-line length
Poetry & lyricsStructural line count for verses or stanzas

Frequently asked questions

Related tools