Guide
Why do word counters give different results?
Hyphens, numbers, emoji and whitespace reveal the counting choices behind a total.
Published
Counters can disagree because they use different boundaries for words and characters. That does not automatically make one wrong. Check the counting rule required by your assignment or software before comparing totals.
Compare identical input
This original example includes a hyphen, a year, Swedish letters and a family emoji. Legibly shows its actual word segments and character counts so the method can be inspected.
A hyphen, a number and a family emoji
E-post, 2026 och blåbär! 👨👩👧👦
| Measure | Value |
|---|---|
| Words | 5 |
| Unique words | 5 |
| User-perceived characters | 26 |
| Characters without whitespace | 22 |
| Unicode code points | 32 |
| UTF-8 bytes | 52 |
Word segments: E · post · 2026 · och · blåbär.
E-post splits at its hyphen, the number is one word-like segment, and the emoji is not a word. The family emoji is one user-perceived character composed of several code points.
Whitespace includes spaces and line breaks. These rules describe a method, not a claim that other counters are wrong.
Words are more than spaces
Legibly uses Intl.Segmenter for the selected language and counts word-like segments. A number can count as a word; punctuation and standalone emoji do not necessarily do so. A hyphen can split an expression. A compound written as one word is not split merely because it contains several meanings.
Sources: ECMA-402: Intl.Segmenter
| Input | Boundary to inspect |
|---|---|
| E-post | A hyphen may separate two word segments. |
| blåbär | Swedish letters remain part of the word. |
| 2026 | A word-like numeric segment can count. |
| Family emoji | One visible character can contain several code points. |
Characters, code points and bytes
The character counter distinguishes grapheme clusters—user-perceived characters—from code points and UTF-8 bytes. Combined accents and multi-part emoji demonstrate why a programming-language string length need not equal the visible character count.
When another system imposes a limit, use its definition. A byte limit, a code-point limit and a visible-character limit can accept different amounts of the same text. Legibly does not claim to reproduce every other application’s rules.
Sources and method
Source content checked . This is not a claim of external expert review.