Line Counter / Line Numberer
Count lines and optionally add sequential line numbers.
What is Line Counter?
The Line Counter reports how many lines your text contains — total, non-empty, blank, and the length of the longest line — and can prefix every line with a sequential number for sharing or debugging.
How it works
The text is split on line breaks and counted. Non-empty lines are those with at least one non-whitespace character. When numbering is enabled, each line is prefixed with its 1-based index, right-padded so the numbers align in monospace.
- Paste text. Paste or type the text you want to analyze.
- Read the counts. Total lines, non-empty, blank and longest-line length update live as you type.
- Add line numbers. Toggle 'Add line numbers' to get a numbered copy you can download or copy.
Examples
Counting a config file
Quickly check how many lines a pasted config or log contains.
Numbering a snippet for review
Add line numbers before sharing code or prose in a chat so reviewers can refer to specific lines.
Common mistakes
Counting a trailing newline
A text that ends with a newline counts the final empty segment as a blank line — matching how most editors report line counts.
Using total when you want non-empty
If your text has blank separator lines, check the 'Non-empty' stat rather than the total for the meaningful count.
Alternatives
Word Counter
Word and character counts instead of line counts.
Text Sorter
Reorder lines after numbering them.
Frequently asked questions
Does an empty last line count?
Yes — a trailing newline produces a final blank segment that counts toward the total and blank-line stats, consistent with most text editors.
Can I start numbering from a different number?
Numbering currently starts at 1. For custom offsets, use the Find & Replace tool on the numbered output.