Line Counter
Count lines, non-empty lines, words, and characters instantly.
Count Lines in Any Text
Paste a list, a log file, a block of code, or a CSV export, and this line counter instantly shows four totals: all lines, non-empty lines, words, and characters. Developers use it to size a snippet or config file, analysts use it to confirm a data export has the expected number of rows, SEO and marketing teams use it to count keywords or URLs in a list, and writers use it to count the lines of a poem or lyric.
How to Use the Line Counter
- Paste or type your text into the box.
- Read the four totals below it. They update with every change you make.
- Click Copy result to copy the totals to your clipboard.
What Each Total Means
- Lines: every line in the box, including blank ones. Technically this is the number of line breaks plus one; an empty box shows 0.
- Non-empty: lines that contain at least one visible character. Lines that are blank or hold only spaces or tabs are left out.
- Words: groups of characters separated by spaces, tabs, or line breaks.
- Chars: every character, including spaces and the line breaks themselves.
The tool counts line breaks, not the way text wraps on your screen. A long paragraph that wraps across several rows in the box is still one line.
Example
Paste four lines where the third one is blank: "apple", "banana split", an empty line, and "cherry". The tool reports 4 lines, 3 non-empty lines, 4 words, and 26 characters (the three line breaks are included in the character total). If the text ends with a line break, which often happens when you copy from a spreadsheet or code editor, the empty line after it is counted too: Lines becomes 5 while Non-empty stays at 3.
Practical Uses
- Checking data before an import: compare the non-empty count with the number of records you expect. A CSV file with a header row should have one more line than it has records.
- Sizing code: get a quick line count for a function or file. The non-empty total excludes blank lines but still includes comments, so it's an approximation of "lines of code," not an exact measure.
- Lists and keywords: count URLs, email addresses, or keywords pasted one per line. If the list may contain repeats, run it through Remove Duplicate Lines first.
- Writing: count the lines in a poem, song, or script excerpt. For word totals, sentences, and reading time, use the Word Counter.
Frequently Asked Questions
Does the line counter include blank lines?
Yes. The Lines total includes every line, whether it has text or not. The Non-empty total leaves out lines that are empty or contain only whitespace, so the difference between the two numbers tells you how many blank lines there are.
Why is my line count one higher than I expected?
Your text probably ends with a line break. The empty line after the final break counts as a line, just as it would in a text editor. Delete the trailing line break, or use the Non-empty total, to get the number you expected.
Does a long line that wraps on screen count as several lines?
No. Only actual line breaks start a new line. A sentence that wraps because the box is narrow still counts as one line, so the result is the same on a phone and on a wide monitor.
How are words and characters counted?
Words are groups of characters separated by spaces, tabs, or line breaks, so "banana split" is two words and "e-mail" is one. Characters include everything in the box: letters, numbers, punctuation, spaces, and line breaks.
Does it handle text from Windows, Mac, and Linux files?
Yes. Browsers convert line endings to a single standard form when text is placed in a text box, so a file saved on Windows produces the same line count as the same file saved on macOS or Linux.
Is there a size limit, and is my text uploaded?
There is no fixed limit; very large pastes are limited only by your device's memory. The counting runs in your browser, and your text isn't uploaded or saved.
Love using BreezyTools?
Go Pro for an ad-free experience, priority features, and support independent development — for less than a coffee a month.