Count Lines

Line count and non-empty lines.

Counts lines and non-empty lines after normalizing newlines. Unlike UTF-8 Bytes this counts lines, not bytes. Unlike Newline Normalize this does not rewrite endings. Empty text fails.

What Count Lines does

Counts lines and non-empty lines after normalizing newlines. Unlike UTF-8 Bytes this counts lines, not bytes. Unlike Newline Normalize this does not rewrite endings. Empty text fails.

The interactive controls for Count Lines load after this article so crawlers still read the instructions. Path /developer/count-lines is the canonical address. Work happens on this device; Tool-You does not take a copy of the file or pasted text for Count Lines.

How to use Count Lines

  1. Keep this tab on Count Lines (/developer/count-lines). Pasting into the wrong Developer tool (for example UTF-8 Byte Length) changes the job.
  2. Paste or type the input Count Lines expects. Path hint: developer · count lines. Line count and non-empty lines.
  3. Apply the Count Lines action only. Newline Normalize is a different transform (Normalize newlines with line count.). Counts lines and non-empty lines after normalizing newlines. Unlike UTF-8 Bytes this counts lines, not bytes. Unlike Newline Normalize this does not rewrite endings. Empty text fails.
  4. Copy the output of Count Lines if you need it elsewhere. Size/complexity still follows: Line count plus non-empty count. Empty fails.
  5. If the text job is actually UTF-8 bytes, code points, and UTF-16 code units., leave Count Lines and open UTF-8 Byte Length.

When not to use Count Lines

Skip Count Lines when a neighbor tool matches better — start with UTF-8 Byte Length or Newline Normalize — or when the description already warns the job will fail. In the tool’s own words: Counts lines and non-empty lines after normalizing newlines. Unlike UTF-8 Bytes this counts lines, not bytes. Unlike Newline Normalize this does not rewrite endings. Empty text fails.

Questions about Count Lines

What does Count Lines do that other Developer pages on this site do not?
Counts lines and non-empty lines after normalizing newlines. Unlike UTF-8 Bytes this counts lines, not bytes. Unlike Newline Normalize this does not rewrite endings. Empty text fails. Short version: Line count and non-empty lines.
Does Count Lines upload my file or text to Tool-You servers?
No. Count Lines runs in this browser tab. Files stay on the device. Limit note: Line count plus non-empty count. Empty fails.
Should I use UTF-8 Byte Length instead of Count Lines?
Use Count Lines when you need Line count and non-empty lines. Use UTF-8 Byte Length when you need UTF-8 bytes, code points, and UTF-16 code units. They share a category (Developer) but not the same job.
What are the limits of Count Lines?
Line count plus non-empty count. Empty fails. Also: Counts lines and non-empty lines after normalizing newlines. Unlike UTF-8 Bytes this counts lines, not bytes. Unlike Newline Normalize this does not rewrite endings. Empty text fails.