DuckyTools
Home Text Line Counter

Line Counter Text

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

Line Counter is a free online tool that count total, non-empty, unique and duplicate lines in any list. It runs entirely in your web browser using plain JavaScript, so files are processed on your own device and never uploaded to a server. There is no sign-up, no file size limit imposed by the site, no watermark and no paid tier.

Price
Free — no account, no quota, no watermark
Category
Text
Where it runs
In your browser, on your device
Files uploaded
None
Technology
plain JavaScript
Settings
None — it just works
Works offline
Yes, after the first visit

About Line Counter

Counting lines sounds unambiguous and is not. A file ending in a newline has, by the POSIX definition, one fewer line than a naive split suggests — which is why `wc -l` and a text editor routinely disagree by one about the same file. This reports total lines, non-empty lines and lines that contain only whitespace separately, so the number you need is visible rather than assumed.

How to use it

  1. Paste or type your text. Every figure recalculates on each keystroke.
  2. Use the sample button to see what the numbers look like on real prose.

Under the hood

Runs onplain JavaScript — runs the whole thing

Questions

Why does my editor show a different number?

Editors count the final empty line after a trailing newline as a line; `wc -l` counts newline characters and does not. Both are defensible, which is why both figures are shown here.

Are Windows line endings handled?

Yes. CRLF, LF and lone CR are all recognized, so a file moved between systems counts correctly.