Text Tools

Line Counter

Count total lines, non-empty lines, empty lines, characters, and words as you type. Nothing you type here is ever sent to Brekzy.

Line Counter Tool

Count Lines

Your text is processed locally in your browser and is not uploaded by this tool.

Statistics

0 Total Lines
0 Non-Empty Lines
0 Empty Lines
0 Characters
0 Words

How Lines Are Counted

Empty text always counts as 0 lines. Otherwise, this tool counts every line break and adds one — the same convention most code editors use to number lines, including a trailing blank line if your text happens to end with a newline. That last part trips people up occasionally: if you paste text that ends with a line break, the count may be one higher than it looks at first glance, because that final (empty) line after the break is still a real, counted line.

Non-Empty vs. Empty Lines

A line counts as non-empty if it still has content after trimming any leading or trailing spaces/tabs. A line made up of only spaces or tabs looks blank, so it's counted as empty, not non-empty — this matches how Brekzy's Remove Blank Lines tool treats whitespace-only lines by default, so the two tools agree with each other.

Why Count Lines?

  • Code and config files: checking a file's length, or confirming a change didn't add or remove more lines than expected.
  • Lists and data: confirming how many rows a pasted list or export actually contains before processing it further.
  • Cleaning up text: spotting how many blank lines are lurking in a document before running it through Remove Blank Lines.

Frequently Asked Questions

How exactly is "Total Lines" calculated?

Empty text is always 0 lines. Otherwise, this tool counts line breaks and adds one, the same way most code editors number lines — including a single trailing newline at the very end of your text, which adds one (blank) line to the count. If your text ends with a newline, that's why the count may be one higher than you expect at first glance.

What counts as a "non-empty" line?

A line whose content still has something in it after trimming leading/trailing whitespace. A line with only spaces or tabs is counted as empty, not non-empty, since it looks blank.

How does this handle different line endings?

Windows-style (CRLF), old Mac-style (CR), and Unix-style (LF) line endings are all normalized before counting, so the result is the same regardless of which line-ending style your text uses.

Do multiple consecutive blank lines count separately?

Yes. Each blank line, even several in a row, is counted individually as its own line, both in Total Lines and in Empty Lines.

Does the word count here match the Word Counter tool?

Yes — both tools use the same word-counting logic (matching runs of letters and numbers, allowing an internal apostrophe or hyphen), so counts stay consistent no matter which tool you use.

Is my text uploaded anywhere?

No. Every count is calculated in your browser using JavaScript. Nothing you type here is sent to Brekzy or stored anywhere.

Is this tool free to use?

Yes, completely free, with no account, sign-up, or usage limit.

Find More Useful Tools

Explore Brekzy's growing collection of free calculators, converters, AI tools, and practical resources.