Lines are the quiet unit of almost everything done with text. A developer wants to know how long a file is, a data manager wants one record per line before an import, a subtitler works to a lines-per-screen limit, and a poet counts lines the way a musician counts bars. Yet most writing apps hide the line count or do not offer one at all — they will happily tell you words and characters while the number you actually need stays invisible. This line counter fills that gap: paste or type anything and it reports the total lines, how many of them carry real content, how many are empty, plus the word and character totals and the length of your longest line, all updating with every keystroke.
The split between total lines and non-empty lines is the heart of the tool, because the two numbers answer different questions. The total tells you the physical size of the text — how many rows a file, list or script occupies. The non-empty count tells you how much actual content there is once the blank rows are stripped away. When the two disagree, the empty-lines figure explains why: blank lines are easy to create by accident (a double Enter here, an export quirk there) and they are invisible until something downstream trips over them. The "ignore empty lines" option simply promotes the content count to the headline number, which is the figure most people checking a list or a data file actually want.
Worked example: the shopping list above
The box starts with a small shopping list, and it is a better test than it looks. The counter reports 7 total lines, 5 non-empty lines and 2 empty lines. The two blank rows — one after the heading and one between "Eggs" and "Bread" — are doing layout work, separating the title and the groups, but they are still lines, and an import tool reading this file would meet them as empty records. The longest line is "Shopping list" at 13 characters, and the whole text holds just 6 words and 38 characters. Tick "Ignore empty lines" and the headline count drops from 7 to 5: same text, two honest answers to two different questions. Delete one blank row and watch the total and empty counts fall together while the non-empty count stays put — that is the fastest way to build a feel for what each number means.
When the empty-line count really matters
Blank lines are harmless in a letter and troublesome almost everywhere else. Spreadsheet and database imports typically treat each line as one record, so ten stray blanks become ten empty rows to clean up later. Mailing-list and email tools can reject a file or create blank contacts. Programmers meet the same issue in configuration files and lists of keys or URLs, where an empty entry may be skipped, may cause an error, or — worst of all — may be silently accepted and surface weeks later as a mystery gap. Checking the non-empty count before you hand a file over takes five seconds here and saves the detective work afterwards. If the blanks turn out to be deliberate, the total-line figure is the one to quote; if they are accidents, our remove duplicate lines and sort lines tools will help you tidy the file properly.
Lines, paragraphs and sentences are different units
These three counts are often confused, and the difference matters whenever a requirement is stated in one unit and checked in another. A line is a physical row: it ends wherever a line break falls, which in a wrapped paragraph depends on the width of the window. A paragraph is a block of text set off by a blank line, regardless of how many rows it wraps across. A sentence is a grammatical unit ending in a full stop, question mark or exclamation mark, and a single line can hold several of them. A four-line address is one paragraph; a one-line slogan can be three sentences. This page counts lines and shows words and characters alongside; for the grammatical view of a longer piece, the word counter adds sentences, paragraphs and reading time.
Frequently asked questions
How does this line counter count lines?
It splits your text at every line break. Each break starts a new line, and a final line without a break at the end still counts. That is the same convention used by text editors and word processors, so the number you see here should match the line count in your file.
What counts as an empty line?
A line with nothing on it at all, or a line containing only spaces or tabs. Whitespace-only lines look blank but still occupy a line in your file, which is why this counter groups them with the empty lines instead of the content lines.
Why does my text show one more line than I expected?
Usually because the text ends with a line break. A trailing break creates one final empty line after the last visible row — many editors and exported files add one automatically. The empty-lines figure on this page lets you spot that instantly.
What is the difference between lines and paragraphs?
A line is a single row of text ending at a line break. A paragraph is a block of one or more lines separated from the next block by a blank line. A five-line address is five lines but one paragraph; a poem of four stanzas has many lines and four paragraphs.
Can I count the lines in a file or document?
Yes. Open the file, select all of its text, copy it and paste it into the box. The counts update as you paste. Because everything runs in your browser, even private documents are safe — nothing is uploaded or stored.
Does it handle Windows line endings (CRLF)?
Yes. Windows files use a two-character carriage-return plus line-feed ending, and older Mac files use a lone carriage return. This counter normalises all of them before counting, so the same text gives the same result whatever system it came from.
Why do blank lines matter when importing data?
Import tools often treat each line as one record. Blank lines can become empty records, failed rows or silent gaps in a spreadsheet or mailing list. Checking the non-empty line count before an import tells you exactly how many real records you are about to load.
Is there a limit to how much text I can paste?
There is no set limit. The counting happens on your own device, so even a very long log file or book-length document works — extremely large pastes may take a moment on a slow phone, but ordinary documents count instantly.
Is this line counter free and private?
Yes. It is completely free with no sign-up, and your text never leaves your device — the counting happens entirely in your browser, so you can safely check drafts, data files and unpublished work.