Count Lines / Words
Paste or type your text below. Lines and words update automatically.
About this tool
Paste text and read its line and word count as you type. Lines are separated by any newline convention; words are whitespace-separated tokens.
How to use
- Paste or type into the text box.
- Read Lines and Words underneath. Both update on every keystroke.
- Leave the tab and come back — the draft is restored from this browser.
Example
Input: hello world good night Lines: 3 Words: 4
The third line is empty: the input ends with a newline, and that trailing empty segment is counted.
How the numbers are defined
-
Lines — the text is split on
\r\n,\ror\n. Empty text reports 0 lines, but a trailing newline adds one empty line, which is how most editors report the lines of a buffer. -
Words — the text is trimmed and split on runs of
whitespace. Punctuation stays attached, so
hello,anddon'tare one word each.
Limits
- This counts lines and words only. There is no character count, byte count, paragraph count or reading-time estimate.
- Languages written without spaces, such as Chinese and Japanese, are counted as very few “words”, because every run of non-whitespace is one token.
-
The draft is written to
localStorageon every keystroke, so a very large paste can exceed the browser's storage quota.
FAQ
Does an empty last line count?
Yes. If the text ends with a newline, that empty segment still counts as a line.
How are words defined?
After trimming the ends, the text is split on any run of whitespace. Punctuation is not stripped.
Does the count update as I type?
Yes. Both numbers refresh on every input event.
Is my text uploaded?
No. Counting happens in the page; the draft is kept in this browser's
localStorage.