← All Tools
Line Counter🔒 100% local
Count lines, empty lines, and characters in text. Useful for code and document analysis.
Input Text
Related Tools
Reports six figures for whatever you paste: total lines, non-empty lines, empty lines, total characters, non-whitespace characters and whitespace characters. A line counts as empty when all it holds is spaces or tabs, and a file that ends with a newline gets a final empty line counted. The counting is a single pass over the string in the page.
How to use it
- Paste the file, log excerpt or text block you want measured.
- Press Count Lines.
- Read the line block first, then the character block below it.
Worked example
alpha
beta
gamma
deltabecomesLine Statistics:
Total lines: 6
Non-empty lines: 4
Empty lines: 2
Character Statistics:
Total characters: 24
Non-whitespace: 19
Whitespace: 5Six lines with two blank ones. The 24 characters minus the 19 non-whitespace ones leave 5, all of them newlines; there are no spaces in the sample at all.
When to use it
- Checking how much a config file or SQL dump grew after a script added or removed lines.
- Confirming a pasted code block kept its blank lines before you send it somewhere that will not show you.
- Sizing a log excerpt or a textarea-limited field before you try to submit it.
What it does not do
- The text is split on \n alone. A file saved with Windows CRLF endings still counts each carriage return as a character, so the line count is right while the character total is one per line too high.
- The newline at the end of a file counts as a line break, so a 100-line file that ends with a newline reports 101 lines.
- It reads nothing from disk. You paste text, and anything you paste around it - indentation, a heading, a trailing marker - is counted along with it.
- Whitespace here means the whole \s class, spaces, tabs, newlines and form feeds alike, so the empty-line figure and the whitespace-character figure are not measuring the same thing.