Skip to content
Jellykit

Line Counter

Count the lines in text or a file: total, non-empty and blank, with the longest line and the kind of line endings used.

  • Runs on your device
Loading tool

About Line Counter

Paste a list, a log or a file and see at once how many lines it holds, how many of them have content and how many are blank. The longest line is found and quoted, which helps when a format or a code style sets a maximum width.

The page also says whether the text ends with a line break and which line endings it uses (Unix LF, Windows CRLF or the old Mac CR), the usual reason two tools disagree about a line count.

How it works

  1. Words, sentences and characters are found with the browser’s language-aware text segmenter, so accented letters, emoji and scripts without spaces are handled sensibly.
  2. Syllables are estimated with English spelling rules (vowel groups, a silent final e, -es and -ed endings), then fed into the published formulas for each readability score.
  3. A line break followed by a lower-case letter is read as a wrapped sentence, not the end of one, so text pasted from an email or a PDF is not over-counted.
  4. Reading and speaking time divide the word count by the speeds you set, 230 and 140 words a minute by default.

Questions

Why is my count one higher than wc -l?

When a text ends with a line break, a text editor shows an empty line after it, and so does this count. The wc command counts line breaks instead, so it reports one fewer. The page tells you whether your text ends with a break.

Does a line with only spaces count as blank?

Yes. A line holding nothing but spaces or tabs is counted as blank, not as a line with content.

How is the longest line measured?

In characters as a reader sees them, so an emoji or an accented letter counts once. When several lines tie, the first of them is shown.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.