Line Counter Online

Count how many lines your text has in seconds: total, with content and blank. Great for code, subtitles and poetry.

0
Total lines
0
With text
0
Blank
0
Words

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

1

Paste your text

Copy the text, code or list you want to analyze and paste it into the box on the left.

2

Read the statistics

The panel instantly shows total, non-empty and blank lines, plus words and characters.

3

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.

Frequently asked questions

Is the line counter free with no limit?
Yes. The line counter is 100% free and imposes no limit: you can count the lines of short texts or whole documents as many times as you need, with no cost and no locked features.
Do I need to sign up to count lines?
No. The tool runs in your browser with no account and no personal data. The text you paste is processed on your own device and is never sent to a server, so your content stays private.
How do I count lines in Word?
Word does not show the line number in the status bar by default: you have to enable it in Page Layout or use the Word Count option, which includes a line count. It is faster to paste the text into this online line counter, which shows the figure instantly.
Does it work for counting lines of code?
Yes. The counter works with any plain text, including source code. Paste a snippet of JavaScript, Python or HTML and you will see how many total lines it has, how many contain code and how many are blank.
What is the difference between a line and a paragraph?
A line is each segment of text separated by a line break (the Enter key). A paragraph can span several visual lines. If you need to work with paragraphs and pages, use our words to pages tool.
Does the counter include blank lines?
Yes. The tool shows total lines, non-empty lines and blank lines separately. You can also turn on the "Ignore blank lines" option so the total only counts lines with content.