Line Counter
Count lines and blank lines in any text.
Loading tool...
Private by design
Your inputs stay in the browser session for this tool run.
Text stays local
Line Counter edits or counts your text in the browser — Count lines and blank lines in any text.
Same-page workflow
Paste once, adjust options, and copy the cleaned result back to your draft.
Free to use
Use Line Counter without creating an account or installing software.
Before you rely on the result
Plain-text rules apply — abbreviations and emoji can change counts. Scan before you submit.
Spot an error? Tell us.
About Line Counter
What this tool does
The Line Counter reports three numbers for any text: total lines, non-empty lines, and blank lines. Paste a list, a log excerpt, or a block of code and see how it breaks down.
Counting lines by hand is tedious and unreliable once a list passes a dozen items. This tool answers the question instantly, and it separates real entries from empty spacer lines.
How to use it
- Paste your text. Add the list or text into the monospaced box. One item per line works best.
- Read the three tiles. Total lines, Non-empty, and Blank update as the text changes.
- Clean up and recount. Delete blank lines or add entries and the numbers follow.
How it works
The text is split at line breaks, whether they come from Windows, Mac, or Linux. The total is the number of pieces; a line counts as non-empty if it contains at least one character that is not whitespace; blank is the remainder, so lines with only spaces or tabs are treated as blank.
An empty box shows zero for everything. A trailing line break at the end of the text creates one more empty line in the total, which is how most editors count it. The tool counts lines of text, not wrapped display lines, so a long sentence that wraps on screen is still one line.
A worked example
Paste apple, banana, an empty line, then cherry on separate lines. The tiles show Total lines 4, Non-empty 3, Blank 1.
Replace the empty line with two spaces and the result is the same, since whitespace-only lines are counted as blank.
What you get
- Total, non-empty, and blank. Three counts shown side by side.
- Works with any line endings. Handles files from Windows, macOS, and Linux.
- Monospaced input. Easy to read lists and code.
- Instant recount. Updates as you edit.
Who it helps
- Developers. Count lines in snippets, logs, and exports.
- Data cleaners. Check how many rows a pasted list contains.
- Writers. Count lines in poems, lyrics, or scripts.
Line Counter FAQs
Yes. Lines that contain only invisible whitespace characters like spaces or tabs are recognized as blank lines by the tool.
Total Lines includes every line break in the text block, including empty spaces. Non-Empty lines counts only those lines that contain actual text, numbers, or symbols.
Yes. You can paste code snippets directly into the tool to measure overall line counts and see how many blank lines are present in your code.
No. The calculation runs entirely inside your web browser using client-side processing. Your text is never uploaded, stored, or processed on an external server.
The line counter detects standard cross-platform line break characters (carriage returns and line feeds), ensuring consistent line counts regardless of which operating system created the text.




