Line Counter
Count the lines in notes, logs, or code. Line endings are normalized in your browser and the text is not uploaded.
About this tool
The counter turns Windows line endings (\r\n) and old Mac line endings (\r) into a single line feed, then splits on that line feed. An empty box has zero lines. A trailing newline counts as a final empty line, so a file that ends with a newline is one line longer than the number of visible rows.
The Word Counter also reports a line count, but it only splits on \n and does not treat a bare \r as a break. Use this page when the line-ending rule matters.
The text locale control on this page is the same choice the other text tools use for casing, word and sentence counts, and sorting. It does not change this line count. Choosing a locale saves only the locale id in this browser. The text itself is not saved there.
The result is a count, so there is no text file to hand to another tool. Sort Lines and Remove Duplicate Lines are the editing tools for the same kind of text.
How to use it
- Paste the text, including its line breaks.
- Read the line count. An empty box is zero lines.
- Start over to clear it. The text stays on this device.
Limitations
- Lines are split on newline characters after Windows line endings are normalized. A final empty line is still a line.
Hard breaks, not wrapped rows
Which breaks become a line
The counter normalizes Windows carriage-return plus line-feed pairs, and bare carriage returns, into line feeds, then splits. An empty box is zero lines. A paste with no break is one line. A trailing break is an extra empty line, so a file that ends with a newline counts one higher than a file that does not. That matches how many rows you will see if you number the lines or sort them. It does not match how many rows a narrow window wraps onto the screen.
Why the word counter can disagree
The word counter’s line figure splits on line feeds only and does not treat a bare carriage return as a break. A classic Mac text file can therefore show one line there and many lines here. If the limit you were given is “lines in the file,” use this page after the endings have been normalized. If you are comparing two tools on purpose, convert the endings once and then compare, or you will be counting the conversion rather than the prose.
Wrapped paragraphs and logs
A paragraph that wraps in the textarea is still one line until a break character exists. Poets and log files care about those characters. Essay pages usually do not. Soft wrapping is a display choice and is not written back into the text. Use the text wrapper when you want break characters inserted at a column. Use this counter when you want to know how many are already there. Blank lines in the middle count. They are empty rows, not missing rows.
A trailing break is a choice the file already made
Editors disagree about whether to save a final newline. This counter follows the characters that are present after normalization, so two files that look identical in a viewer can differ by one line. When you are checking a generator’s output, decide whether the spec requires that final break before you call the count wrong. Soft wrapping in the box never adds that break.
Privacy
Your text is processed in your browser and is not uploaded to UtilChain. The text is not included in analytics.

