On this page
The word counter does not look words up in a dictionary. countWords deletes invisible characters, turns every Unicode space into a normal space, trims the ends, then counts each run of non space characters as one word. The text stays in the browser. The component does not send it anywhere.
The six numbers on the page are not six copies of the same idea. Characters with spaces use the raw string length. Characters without spaces strip whitespace from that raw string. Sentences and paragraphs use their own splits. Reading time is only the word count divided by 200.
Input
Output
Input
Output
A short line
This string was passed through the same functions the page uses:
Hello Casablanca.
| Stat | Value | | --- | --- | | Words | 2 | | Characters (with spaces) | 17 | | Characters (no spaces) | 16 | | Sentences | 1 | | Paragraphs | 1 | | Reading time | < 1 min |
The comma or the period does not start a new word. Hello, Casablanca. is still two words, because the comma sits on the first token. A hyphenated form such as a compound written with a hyphen and no spaces is one word too. The counter never asks whether the token is English.
Two paragraphs
This input has a blank line between the sentences:
Hello Casablanca.
The market opens at 8.
Words: 7. Characters with spaces: 41. Characters with no spaces: 34. Sentences: 2. Paragraphs: 2. Reading time stays under 1 minute, because 7 divided by 200 is far below 1.
Paragraphs are splits on a blank line (\n plus optional space plus \n). A single line break without a blank line stays one paragraph. Sentences are chunks split on ., !, or ?. A line with no ending mark still counts as one sentence if it has text. Hello with no period is 1 sentence. Hello. World. is 2.
Spaces are not all the same
one two three (three spaces, then a tab) is 3 words. The raw length is 15 characters. Stripping whitespace leaves 11 characters: onetwothree. Extra spaces change the character totals. They do not add words.
A non breaking space between one and two is normalized into a normal space first, so the word count is 2. A zero width character between those letters is deleted, so one and two glue into one word. That is why a paste from a web page can disagree with a count you did by eye. The invisible mark is real in the string, and the word function removes it before it counts.
Empty text is 0 words, 0 characters, 0 sentences, 0 paragraphs, and the reading time label 0 min.
What “characters” means here
Characters with spaces are text.length. That is the JavaScript length of the string you pasted, before word normalization. Characters with no spaces are that same string after .replace(/\s/g, ""). Those two numbers can move when the word count does not, and the word count can move when you only delete a zero width mark.
This is not a grapheme counter. An emoji or a character outside the basic multilingual plane can take two JavaScript code units, so text.length can be higher than the number of shapes you see. If a limit on a form is “characters” in the human sense, check that form. This page reports the JavaScript length.
Reading time is a division
The page uses 200 words per minute. There is no second speed and no measurement of a real reader.
- 0 words shows
0 min. - Any count under 200 words shows
< 1 min. - 200 words shows
1 min. - A count that is not an exact multiple of 200 shows one decimal, from
toFixed(1), then the wordmin.
Rabat is the capital. Casablanca is larger. Fes keeps the old walls. is 12 words, 68 characters with spaces, 57 without, 3 sentences, 1 paragraph, and under 1 minute. Twelve divided by 200 is 0.06, which is still under the one minute branch. The label is not 0.1 min.
What this page will not do
It will not tell you the reading level of the prose. It will not ignore headings you pasted. If the heading is in the box, it is part of the string. It will not save the draft. Refreshing the page clears the box, because the text lives in component state.
The reading time estimator is a different page. Capitalization is the case converter. This counter’s clock is only words divided by 200. If you need a count of lines, this page does not have that tile. A line break is not a paragraph unless the next line is blank.
Arabic and French text use the same space rule. The Arabic interface translates the tile labels. It does not change how a word is detected. A string with no spaces is one word, however long it is.

