Khmer word counter
Khmer has no spaces between words, which is why ordinary counters get it wrong.
Why every other counter says nine
Khmer is written without spaces between words. A space in Khmer marks a phrase or a clause, roughly where English would use a comma — so a word counter that splits text on whitespace reports a whole paragraph as one enormous word, and an article as nine of them.
Anyone who has pasted Khmer into an ordinary online counter has seen this. The number is not slightly off; it is meaningless.
How this one works
Your browser already knows where Khmer words end — it needs to, because it has to decide where to break a line of Khmer text. That dictionary is available to any page through Intl.Segmenter, and that is what does the counting here.
It is also why this runs in your browser rather than on our server: the answer is already installed on your own machine. Your text is never sent anywhere, which matters for a draft nobody has published yet.
What the numbers are for
Word count is what a translator, a copywriter and a client all price by, and being able to state it accurately for Khmer is worth more than it sounds when the alternative is an estimate.
The Khmer and Latin breakdown is the useful one for mixed text. A page that is meant to be Khmer but counts three hundred Latin words is a page where the translation is not finished — which is easier to see here than by reading it.
Reading time is a rough guide at 180 words a minute. It is for pacing a script or a presentation, not a promise.
A note on characters
Khmer builds a syllable from a base consonant plus subscripts and vowel marks, so one thing you see can be three or four characters. That is correct rather than a bug: it is what a database field, an SMS limit and a meta description length are all counting.
If a number here looks higher than the text appears, that is why. The character count is what a computer counts; the word count is what a person means.

