CountWord.com

Free Line Counter

Paste or type your text below for an instant line count. You'll see total lines broken down into non-empty and empty lines, plus paragraph count — all updating live as you type. Especially useful for code, CSV files, poetry, scripts, and data processing tasks.

0
Total Lines
0
Non-Empty Lines
0
Empty Lines
0
Paragraphs

When Line Count Matters

Line count is a deceptively versatile metric. Depending on the context, the number of lines in a document can carry significant practical meaning.

Programming and code review

Lines of code (LOC) is one of the most cited, if controversial, measures in software engineering. While LOC is a poor measure of productivity or quality, it is useful for estimating complexity, tracking growth of a codebase over time, and for billing clients on a per-line basis in some translation and documentation contexts. Many coding standards and code review tools also set maximum file lengths — for example, Google's style guides recommend keeping files under 400–800 lines. This counter helps you quickly check whether a pasted code file exceeds those limits.

CSV and data files

In CSV (Comma-Separated Values) files and other flat data formats, each line typically represents one data record. Knowing the line count tells you the number of records at a glance. If you have a 10,000-line CSV, you have (minus one for the header row) 9,999 data records. This is a common sanity check when processing exports from databases, CRM systems, or analytics tools.

Poetry and verse

Line count is fundamental to poetry analysis and composition. Different poetic forms have strict line requirements: a haiku has 3 lines, a sonnet 14, a villanelle 19, a sestina 39. Even free verse poets track stanza lengths and total line counts when formatting their work for publication. The empty-line count is particularly useful here — empty lines between stanzas are visually significant and need to be intentional.

Screenwriting and scripts

In screenwriting, the standard rule of thumb is one page equals approximately one minute of screen time, and each formatted page of a script holds about 55–60 lines. A feature-length screenplay typically runs 90–120 pages (4,950–7,200 lines). Line count helps screenwriters estimate run time and track progress toward their target length.

Subtitles and captions

Subtitle files (SRT, WebVTT) are line-structured: each subtitle entry consists of an index number, a timecode range, and then the caption text — typically one or two lines. Counting lines in a subtitle file helps estimate the translation workload and verify file completeness.

Legal and compliance documents

Some legal jurisdictions and formatting standards (court filings, contracts, regulatory submissions) specify maximum line counts per page or document. Knowing your line count allows you to verify compliance before submission.

Lines vs Paragraphs — What's the Difference?

These two concepts are often confused:

MetricDefinitionHow Counted
Total lines Every line in the text, including empty ones Split text on newline character; count all segments
Non-empty lines Lines that contain at least one non-whitespace character Same as above, filter out blank/whitespace-only lines
Empty lines Lines containing only whitespace (or nothing at all) Total lines minus non-empty lines
Paragraphs Blocks of text separated by one or more empty lines Split on sequences of two or more consecutive newlines

A practical example

Consider a simple two-paragraph text with a blank line between the paragraphs:

In code, lines and paragraphs diverge further. A function in Python may have 20 lines but no "paragraphs" in the prose sense. Use whichever metric is meaningful for your specific use case.

Line Count Reference by Document Type

Document TypeTypical Line CountNotes
Haiku3 lines5-7-5 syllable structure
Limerick5 linesAABBA rhyme scheme
Sonnet14 linesPetrarchan (8+6) or Shakespearean (3×4+2)
Villanelle19 lines5 tercets + 1 quatrain; see "Do Not Go Gentle"
Tweet / X post1–3 lines280-character limit caps length naturally
Email (body)5–20 linesShorter is better; under 125 words is optimal
Blog post (standard)60–150 linesDepends on paragraph length; ~1,500–2,500 words
Screenplay (feature)4,950–7,200 lines~90–120 pages at ~55 lines per page
Short story50–400 lines1,000–7,500 words
Novel3,500–5,000+ lines70,000–100,000 words at ~20 words per line
Source code fileTypically < 400–800Most style guides recommend keeping files short
CSV export (1k records)1,001 lines1 header row + 1,000 data rows

Frequently Asked Questions

Does an empty document count as 0 lines or 1 line?
An empty textarea contains no text, so this counter returns 0 lines. Some text editors report a new empty file as having 1 line (because there is technically a cursor on line 1). This counter starts from 0 and counts actual newline characters plus 1 for the final line of content — so a single word with no newlines counts as 1 line.
How are paragraphs counted?
Paragraphs are counted by splitting the text on sequences of two or more consecutive newlines (i.e., a blank line between blocks of text). A single block of text with no blank lines is one paragraph, regardless of how many line breaks it contains. This matches the conventional prose definition of a paragraph as a block of text separated from others by blank lines.
Why does my line count differ between operating systems?
Windows uses CR+LF (two characters) as its line ending; Unix and macOS use just LF (one character). When text is created on Windows and pasted into a browser, the line endings may vary. This counter splits on the newline character (LF) and handles Windows line endings correctly — each CR+LF pair is treated as a single line break.
Is a line with only spaces counted as empty or non-empty?
This counter treats lines containing only whitespace characters (spaces, tabs) as empty lines. Only lines with at least one non-whitespace character count as non-empty. This matches the most common expectation for programming and data tasks.
Is my text stored anywhere?
No. All counting runs entirely in your browser. Nothing you type or paste is ever sent to our servers.