Count lines and blank lines in plain text
Lines count actual line breaks. Nonempty lines count only lines with content beyond whitespace.
A line counter measures lines in the text itself, rather than rows produced by the width of your screen. In the Character Counter, each line break starts another line. Empty lines are included, and a line break at the end starts a final empty line. The breakdown also shows nonempty lines, which helps you check lists or pasted text where blank spacing shouldn't count as a content entry.
By TechCompare · Updated
Calculator
Character Counter
Example text
First entry Second entry Fourth line
- Characters
- 38
- Words
- 6
- Sentences
- 3
- Paragraphs
- 2
- Lines
- 5
- No whitespace
- 31
How this is calculated
A long sentence can wrap across several visible rows in the editor and still occupy one actual line. Resize the browser and those visible rows change, while the line count stays the same. Press Enter and the count increases because the text now contains a line break. Windows line endings use a carriage return and a line feed together. This tool normalizes that pair to one line break, and it handles a standalone carriage return the same way. A completely empty input has zero lines here. Once there is text, a final newline creates an empty last line, which explains a common one-line difference between counting tools.
Verdict
Choose the total that matches the question you're asking. Use Lines for the structure of a text file, including its blank spacing. Use Nonempty lines when you're checking a list that may contain empty rows. A wrapped paragraph isn't a list of separate lines, and a line can contain more than one item if they're separated by commas or other characters. The count won't decide whether those entries are valid. If you're preparing data for another program, inspect its expected format and final newline behavior before treating the count as a record total.
More Counting scenarios
Frequently asked questions
Does the character count include spaces?
Can I count only certain characters or words?
What's the difference between a line and a paragraph?
How are emoji, words, and sentences counted?
Is my text uploaded or saved?
Can I count just part of my text?
Related tools
LLM Token Counter
Count tokens in any prompt for GPT, Claude, Gemini, and Llama with exact OpenAI tokenization.
Use tool ➜Text Encoding Converter
Convert between Text, Base64, Binary, Hexadecimal, and Decimal formats.
Use tool ➜JSON Formatter
Validate, format, and minify JSON data with readable output and error detection.
Use tool ➜