A trailing newline creates another line
Splitting text on newline characters means a final newline leaves an empty final entry. This matches many editor and file-format interpretations of a terminated line.
Count total lines, blank lines, and non-blank lines in pasted text or code with line length statistics.
The guide
The line counter treats every newline as a boundary, including blank lines. It reports total, blank, and non-blank lines plus characters, words, average non-blank line length, and the longest line. A distribution reveals how many lines fall into common width bands.
A concrete input and expected output from the current implementation.
Input
alpha beta gamma
Expected output
3 total lines, 2 non-blank lines, 1 blank line
The empty row between alpha and beta gamma is a real blank line. The longest line contains ten characters including the internal space.
Splitting text on newline characters means a final newline leaves an empty final entry. This matches many editor and file-format interpretations of a terminated line.
The current line-length statistics use JavaScript string length. Combined emoji and some non-BMP characters can therefore occupy more than one counted unit.
A newline is a separator. When text ends with one, there is an empty segment after the final separator.
No. Visual wrapping depends on window width and styling. The tool counts explicit newline characters only.
The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.
Sent. Thank you.