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.
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:
| Metric | Definition | How 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:
- Total lines: 5 (3 content lines + 1 empty line + 1 final content line, depending on structure)
- Non-empty lines: 4 (the content lines only)
- Empty lines: 1 (the separator)
- Paragraphs: 2 (the two blocks of content)
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 Type | Typical Line Count | Notes |
|---|---|---|
| Haiku | 3 lines | 5-7-5 syllable structure |
| Limerick | 5 lines | AABBA rhyme scheme |
| Sonnet | 14 lines | Petrarchan (8+6) or Shakespearean (3×4+2) |
| Villanelle | 19 lines | 5 tercets + 1 quatrain; see "Do Not Go Gentle" |
| Tweet / X post | 1–3 lines | 280-character limit caps length naturally |
| Email (body) | 5–20 lines | Shorter is better; under 125 words is optimal |
| Blog post (standard) | 60–150 lines | Depends on paragraph length; ~1,500–2,500 words |
| Screenplay (feature) | 4,950–7,200 lines | ~90–120 pages at ~55 lines per page |
| Short story | 50–400 lines | 1,000–7,500 words |
| Novel | 3,500–5,000+ lines | 70,000–100,000 words at ~20 words per line |
| Source code file | Typically < 400–800 | Most style guides recommend keeping files short |
| CSV export (1k records) | 1,001 lines | 1 header row + 1,000 data rows |