Line Counter Online
Count how many lines your text has in seconds: total, with content and blank. Great for code, subtitles and poetry.
Characters: 0
Options
What is a line counter?
A line counter is a tool that analyzes a text and tells you how many lines it contains. A line is each segment separated by a line break, that is, every time the Enter key is pressed. It does not depend on how many words it has: a line can be empty, contain a single word or a long paragraph.
Our line counter goes beyond the total. It distinguishes between non-empty lines and blank lines, two figures that matter when you work with code, subtitles or poetry. The statistics update in real time as you type or paste the content.
Counting lines by hand is slow and error-prone as soon as the text grows past a few rows. This tool automates that count and, on top of that, does it without sending your text to any server: all analysis happens in your browser.
How to count the lines of a text
Paste your text
Copy the text, code or list you want to analyze and paste it into the box on the left.
Read the statistics
The panel instantly shows total, non-empty and blank lines, plus words and characters.
Adjust the options
Turn on "Ignore blank lines" or "Trim whitespace" to fit the count to your case.
Total, non-empty and blank lines
The counter offers three different counts because each one answers a different question.
Total lines
It is the number of line breaks plus one: it counts absolutely every row, whether it has content or not. It is the figure most code editors and forms with a line limit ask for.
Non-empty lines
It counts only the lines that contain at least one visible character. It is the useful count for knowing how many verses a poem has or how many real items there are in a list, ignoring blank separators.
Blank lines
It is the difference between the total and the lines with text. Knowing how many blank lines there are helps you spot extra spacing before publishing code or handing in a document.
What is counting lines for?
Counting lines is a common need in very different contexts. These are the most frequent ones.
Programming
Lines of code are a basic metric to estimate the size of a file, compare snippets or respect the limits of some code reviews.
Subtitles
Subtitling guidelines recommend a maximum of 2 lines per block. Counting lines helps you check that each subtitle fits on screen and stays readable.
Poetry and verses
In poetry, each verse takes one line. Counting non-empty lines tells you how many verses a stanza or a whole poem has, instantly.
Lists and forms
When a list has one item per line, counting lines equals counting items. It is useful for inventories, to-do lists or fields with a maximum number of entries.