Line Counter
Count total lines, non-empty lines, words, and characters for any block of text.
Knowing the exact line count of a text file, code snippet, or document section is needed for many development and writing tasks. This counter provides total lines, non-blank lines, word count, and character count simultaneously — giving you a complete statistical overview of any pasted text.
Total lines: 0
Non-empty lines: 0
Characters: 0
Words: 0
How to Count Lines in Your Text
- Paste your text — paste the content you want to analyse.
- View the counts — the tool instantly shows total lines, non-blank lines, words, and character counts.
- Use the data — check file sizes, verify length limits, or analyse text structure.
Frequently Asked Questions
How are lines counted? ▼
Each line break (newline character) creates a new line. The total line count includes blank lines. The "non-blank lines" count excludes lines that contain only whitespace. This matches the behaviour of the Unix "wc -l" command.
What is the difference between this and a word counter? ▼
A line counter focuses on lines (separated by newlines), while a word counter counts individual words (separated by spaces). This tool provides both, plus character counts, giving you a complete text statistics overview.
Can I use this to count lines of code? ▼
Yes. Paste your source code and the tool will count total lines and non-blank lines. Non-blank lines is closer to "lines of code" (LOC) metrics used in software development, though a true LOC counter would also exclude comments.
How are blank lines counted? ▼
A blank line is any line that contains no characters or only whitespace (spaces, tabs). The tool shows both the total line count (including blanks) and the non-blank line count so you can see both metrics.
What character encoding does this support? ▼
Since it runs in your browser, it supports whatever your browser supports — which is full Unicode (UTF-8/UTF-16). This includes characters from all languages, emoji, and special symbols.
Is my text stored? ▼
No. All counting happens in your browser. No text is sent to any server.