Line Counter
Count lines in pasted or uploaded text — total lines, blank lines, non-blank lines, words and characters. Handles mixed CRLF/LF/CR line endings correctly, updated live as you type.
Input
Output
Line Statistics
| Metric | Value |
|---|---|
| No data yet | |
Guides
What does this line counter measure?
Paste or upload any block of text and get an instant breakdown: total lines, non-blank lines, blank lines, words and characters. It's built for anyone who needs an accurate line count without opening a code editor or spreadsheet — logs, CSV exports, source code, poetry, scripts, config files, or plain prose.
A line is counted the same way your text editor counts it: every line break — whether it's a Unix \n, a Windows \r\n, or an old Mac \r — ends one line and starts the next. Files with mixed line endings (common after copy-pasting between operating systems, or concatenating files from different sources) are counted correctly instead of inflating the total when a \r\n gets miscounted as two breaks.
A line counts as blank when it's empty or contains only whitespace (spaces, tabs) — trimmed before the check, so a line with a few stray spaces still counts as blank rather than "non-blank." Non-blank lines are simply the total minus the blanks.
Who is it for?
- Developers checking the size of a script, log file, or config before pasting it somewhere with a line limit.
- Writers and editors counting lines in a poem, screenplay, or formatted manuscript where line breaks matter more than word count.
- Data and QA folks doing a quick sanity check on a CSV or export — total rows, and how many are actually empty.
- Anyone who just got a "how many lines is that file" question and doesn't want to open a terminal.
How to use it
- Paste your text into the box, or drop a
.txtfile onto the uploader — the file's contents load straight into the text box. - Read the stats table: total lines, non-blank lines, blank lines, words, and characters, all updated live as you type or edit.
- Copy a value or re-paste different text — the count refreshes instantly with no need to click a button.
Why do CRLF and LF matter?
Windows text files typically end each line with \r\n (carriage return + line feed), while Unix, Linux and macOS use just \n. Some older tools and legacy Mac files use a lone \r. If a tool naively counts every \r and every \n as separate breaks, a Windows-style file ends up reporting roughly double its real line count. This counter treats \r\n, \n, and \r each as exactly one line break, so the same content reports the same line count no matter which platform it came from.
What counts as a blank line?
Any line that is empty, or contains only spaces/tabs, is counted as blank. A line with visible text — even a single character — counts as non-blank.
Privacy
Counting happens entirely in your browser. Your text never leaves your device, and uploaded files are read locally — nothing is sent to a server.