Line Counter
Paste any text to instantly count total, empty, and non-empty lines, plus the longest line length.
0
Total lines
0
Non-empty lines
0
Empty lines
0
Longest line (chars)
Frequently Asked Questions
What counts as an empty line?
A line that's blank or contains only whitespace after trimming counts as empty.
Why would I need the longest line length?
It's handy for spotting lines that might overflow a fixed-width display, log column, or code style limit (like 80 or 120 characters).
Does this work on code files?
Yes — paste any plain text, including source code, logs, or CSV data, and it works the same way.
Related free utility tools
- Remove Duplicate LinesStrip duplicate lines from a list while keeping the original order, with a case-sensitive toggle.
- Remove Empty LinesStrip blank and whitespace-only lines from any text, with an optional trim toggle.
- Sort LinesSort a list of lines alphabetically A-Z, Z-A, or by line length, shortest or longest first.
- Reverse TextReverse text by character, word order, or line order instantly.
- Text Diff CheckerCompare two blocks of text line by line with additions and removals highlighted.
- Slug GeneratorTurn any title into a clean URL-friendly slug with hyphens or underscores.
Explore CodeSpeedTest