Delete repeated lines, keep order, ignore case or spaces
Line Counter
Count the lines in a list, a log or a file, and find the longest one, without opening an editor.
Loading tool…
How to use line counter
Paste text or open a file (txt, csv, log, srt and others).
Read the line count, lines with text, blank lines and unique lines.
See the longest line, its length and its line number.
Turn on the list to see the length of every line.
What this tool does
- Understands Windows (CR LF), Unix (LF) and old Mac (CR) line endings.
- Does not count a final line break as an extra empty line, matching code editors.
- Counts unique lines and repeats, so you know whether a list needs deduplicating.
- Measures line length in visible characters, so an emoji counts as 1.
How the result is verified
The longest line is reported by number; turn on the list to see it highlighted with every other line's length, and compare a few with your editor's column counter.
Frequently asked questions
Does an empty last line count?
No. A line break at the very end of a file finishes the last line rather than starting a new one, which is what code editors and wc -l on a well-formed file show.
What counts as a blank line?
A line that is empty or contains only spaces and tabs.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Delete blank lines, or keep one between paragraphs
Number lines with any start, step and format, or strip them
Live word count with a limit bar, unique words and reading time
Characters with and without spaces, code points and UTF-8 bytes