About the Line Counter
Sometimes you need to know exactly how many lines a text has: a list of emails, a log extract, a block of code, a poem, a CSV column. This line counter shows the total number of lines, how many contain text, how many are blank, how many are different and how many are repeats of an earlier line. It also gives the word and character counts. It treats a final line break at the end of the text as the end of the last line rather than an extra empty one, so the count matches what you expect in an editor.
Updated October 2026
How to use the Line Counter
- 1Paste or type your text in the box.
- 2Choose how duplicates are compared: with or without case and surrounding spaces.
- 3Read the total line count in the large result.
- 4Check the blank, different and repeated line counts below.
- 5Copy the summary if you need it elsewhere.
Typical uses
- Checking how many rows a pasted spreadsheet column has.
- Counting entries in a mailing list or keyword list.
- Measuring the length of code or a script.
- Spotting duplicate entries before importing a list.
- Counting verses or lines of a poem or song.
A note on wrapped lines
The tool counts real line breaks, not lines that wrap on screen. A long paragraph typed as one line counts as one line even though it takes many rows in a narrow window. If you want to count the visual rows of a printed layout, wrap the text first or use a word processor's statistics instead.
One practical tip: if your numbers disagree with another program, check how it handles the final line break and blank lines. Some editors show an extra empty line at the end of a file, while command line tools count only the line breaks, and files from different systems may use different line endings. This tool counts lines the way most people expect, and the separate blank-line figure lets you reconcile the difference quickly.
After counting
Use the Remove Duplicate Lines tool to clean repeats, the Sort Lines tool to put them in order, the Line Length Finder to find the longest and shortest lines and the Head and Tail Text tool to extract the first or last lines. The Word Counter measures overall length and the Comma Separator Tool joins lines into a list.
Features
- Total, non-blank and blank lines
- Different lines and repeated lines
- Choice of case and space handling
- Words and characters as well
- Handles Windows and Unix line breaks
- Fast, private and free
Frequently asked questions
How do I count the lines in a text?
Paste it into the box and read the total in the result. The count updates as you type or paste, and it does not matter whether your line breaks come from Windows, Mac or Linux.
Does the last empty line count?
No. A single line break at the very end of the text just finishes the last line, as in most editors and in the wc -l command. Extra blank lines before the end are counted.
What counts as a blank line?
A line with nothing on it, or only spaces and tabs. These are shown as blank lines, while lines with any visible character count as lines with text.
How are duplicate lines found?
Each non-blank line is compared with the others, ignoring case and spaces at the ends by default. The number of repeated lines is the count of lines that are copies of an earlier one. You can switch the comparison to be strict.
Can it count lines in a large file?
Yes, as long as you can paste the text. Everything is counted in your browser, so very large files, hundreds of thousands of lines, work best on a computer.
How is it different from a word counter?
A word counter measures words and characters, while a line counter measures rows of text. Lists, poems, subtitles, code and data files are measured in lines, so this is the right tool for those.