Reference
Unicode Text Segmentation
How Unicode defines grapheme clusters and word boundaries, and why a character is not always one code point.
Unicode text is a sequence of code points, but users perceive characters and words. Unicode Standard Annex #29 defines grapheme cluster boundaries (what looks like one character) and word boundaries (where a word starts and ends), so conforming tools agree.
01What the rules give you
- Grapheme clusters group a base character with its combining marks and joined emoji.
- Word boundaries follow locale-neutral rules with optional tailoring.
- A UTF-16 index, a code-point count, and a grapheme count can all differ for the same text.
Code units are not characters
An emoji outside the Basic Multilingual Plane occupies two UTF-16 code units but one code point and, usually, one grapheme cluster.
02Limitations
Segmentation rules are versioned, so a text editor, a regex engine, and a browser that implement different Unicode versions can disagree at the margin.
Sources
- Unicode Standard Annex #29: Unicode Text Segmentation — Unicode Consortium (accessed 2026-09-27)
- Unicode Standard Annex #15: Unicode Normalization Forms — Unicode Consortium (accessed 2026-09-27)
Test this in your browser
The tool runs entirely in your browser; the input you use never leaves it.
About the author
Gampangin builds and maintains free, browser-based developer tools and the documentation that makes them trustworthy. The organization is accountable for every page published on this site.