Skip to content
TextArray
100% local

Count words per line

Add word counts to each line of your text.

Input
Output

Count words per line

Paste any text and add the word count to each line instantly. This tool is helpful when editing line-by-line documents, analyzing text density, or understanding the structure of your writing. Every line gets numbered with its word count: by default the count appears in parentheses at the end, but you can also prepend the count or display only the counts.

The tool counts words as runs of non-whitespace characters, so hyphenated compounds like "well-known" count as one word, and words with diacritics like "naïve" count normally. Empty lines are counted as zero words. Line endings (Windows CRLF, Unix LF, or old Mac CR) are handled transparently, so the output is always clean.

Choose your format from the dropdown: suffix adds the count after the line in parentheses, like "hello world (2)"; prefix puts the count at the start with a tab separator, like "2 → hello world"; count-only strips the text and shows just the numbers, useful for statistical analysis. The live tally shows the total line count and total words in your input, updated as you type.

Everything is calculated in your browser. Your text is never uploaded, so you can safely work with confidential documents or unpublished drafts. Copy the result, download it as a .txt file, or send it to another tool when you are done.

FAQ

What counts as a word?
Any sequence of non-whitespace characters counts as one word. Punctuation attached to a word (like "hello," or "world.") makes it one word, and diacritics (like "naïve" or "señor") do not split words.
How are empty lines handled?
Empty lines and lines with only whitespace are counted as zero words. They still appear in the output (unless you choose count-only) so the line count remains accurate.
What is the difference between the three formats?
Suffix appends the count at the end in parentheses; prefix prepends it at the start with a tab. Count-only strips all text and shows only the numbers, one per line.
Which line ending does it support?
The tool handles Windows (CRLF), Unix (LF), and old Mac (CR) line endings transparently. The output always uses Unix line endings.