Line Counter
The Line Counter helps you count the total number of lines and non-empty lines in text quickly and accurately. Check line counts in source code, log files, configuration files, lists, and documents without manually counting each line. This free online line counting tool makes text analysis simple for developers, writers, students, and everyday users. Paste your text to see the line count instantly.
A few lines of sample text. Load the example to see the tool in action.
A line is counted for each line break, so text that ends with a line break includes a final blank line.
What is Line Counter?
A Line Counter calculates the number of lines in a text block, including non-empty lines where supported. Use this free online line counting tool to analyze source code, log files, configuration data, lists, and documents without manually counting each line. Paste your content to check its line count and understand the size of your text.
Why use this tool?
- Paste code, logs, lists or documents and see the line count update as you type.
- Separates non-empty lines from blank lines and counts unique non-empty lines.
- Also shows word and character counts.
How to use Line Counter
- Step 1. Paste or type your text into the box.
- Step 2. Read the line statistics shown under it.
- Step 3. Edit the text to see the counts update.
Common use cases
Important notes
- Lines are counted for each line break, and both Windows and Unix line endings are handled.
- Text that ends with a line break includes a final blank line in the count.
- Wrapped text counts as one line until a line break is entered.
- Unique lines are compared after trimming spaces from the start and end of each line.
More Text Tools
Line Counter FAQ
How do I count lines in a text file?
Open the file, copy the text and paste it into the box. The line count appears straight away.
Why does my count differ from wc -l?
The wc -l command counts line break characters, so a file with no final line break reports one line fewer than the number of lines of text.
Are blank lines counted?
Yes. They count in the total, and the tool also shows how many lines are blank and how many are not.
Can it find duplicate lines?
It shows how many unique non-empty lines there are. Compare that with the non-empty total to see how many are duplicates.