Text Tools
Online Line Counter
Count total, non-empty, blank and repeated lines, find the longest line and flag lines over a length limit, with average length, words, characters and bytes.
How to use Online Line Counter
Paste text on the left and the counts update as you type. By default a final line break does not add a line, as with wc -l. To check code, CSV or subtitles for width, enter a character limit and the result lists the line numbers that exceed it.
- Paste your textPaste a list, a log, source code, a CSV export or subtitles; every line break starts a new line.
- Set the rulesDecide whether a final line break adds a line, and enter a length limit such as 80 if you need one.
- Read the resultsSee total, blank and repeated lines, the longest line and the line numbers of any over-long lines.
Total, blank and repeated lines
Blank lines are lines that are empty or contain only spaces; non-empty lines contain at least one visible character. A repeated line is a non-empty line that matches an earlier one, ignoring spaces at either end. In the sample, 6 lines include 4 non-empty and 2 blank ones, banana appears twice so there is 1 repeated line, and the longest is line 5 at 45 characters. The average length of the non-empty lines, 15.5 characters here, shows how even the data is.
Final line breaks and line length
Most editors end a saved file with a line break. By default the empty line after it is not counted, which matches wc -l and the line count on GitHub; untick the option to count what the text box shows. Line length counts characters as you see them, so an accented letter or an emoji counts once. Set a limit to find code lines or records longer than 80 or 120 characters before a linter or an import complains.
Accuracy and data handling
Before copying the output, check names, punctuation and the intended meaning against the source text. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
Does a trailing line break add a line?
Not by default, matching wc -l. Untick Don't count the empty line after a final line break and that empty line is added to the total and blank counts.
Why can the byte count be higher than the character count?
UTF-8 stores many characters in more than one byte: accented letters take two bytes and Chinese characters three, so text with them has more bytes than characters.
Is my text uploaded?
No. Every count is worked out in your browser, and nothing you paste is sent to a server or stored.
More Text Tools
Related toolsEstimate read time and read-aloud time for any article or script.
Dummy Latin or Chinese placeholder text by paragraph, sentence or word.
Compare two texts and highlight added, removed and changed lines.
Clean double spaces, stray tabs, blank lines and invisible characters.
Sort a list A to Z, naturally, by number or by length.
Delete blank lines or squeeze runs of them down to one.