Documents

Line Counter

Count total lines, blank lines, and non-blank (code) lines in pasted text or a text file. Useful for developers assessing code size and writers assessing document structure.

Drop your file here

or click to choose from your device

Supported: txt · Max 5 MB

txt · 5 MB max

Going deeper

Counting lines for code and prose

Line counts are most useful for code, where they're a proxy for complexity and size. Total lines give a sense of overall scale; blank-line and non-blank-line breakdowns give a sense of structure (lots of blank lines means lots of section breaks; few blank lines means dense code). Longest-line length helps with style enforcement — most style guides cap line length at 80 or 120 characters for readability.

For prose, line counts matter less than word counts, but they're still useful for assessing document structure. A 1000-word document with 50 lines (averaging 20 words per line) is dense, formal prose — an academic essay or a technical report. The same word count with 200 lines (5 words per line) is a list, a poem, or a slide deck. The line-per-word ratio tells you something about the document's nature.

Line ending normalization is the most common gotcha. A file created on Windows has CRLF line endings (two characters); the same content on Linux has LF (one character). Tools that naively split on \n will count Windows files incorrectly — every line break counts as two. We normalize all variants to a single line-ending style before counting.

What you get

Features

  • Total line count

  • Blank line count

  • Non-blank (content) line count

  • Longest line length

  • No data leaves your browser

Step by step

How to use

  1. 1

    Paste text into the box, or upload a .txt file.

  2. 2

    Counts update instantly.

Your privacy

How this tool handles your file

Line counting happens entirely in your browser. No text is uploaded.

Read more about our security practices or see our privacy policy.

Frequently asked

Common questions

Looking for something else? Browse all tools or ask us to build one.