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.

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

  1. Unicode Standard Annex #29: Unicode Text Segmentation — Unicode Consortium (accessed 2026-09-27)
  2. Unicode Standard Annex #15: Unicode Normalization Forms — Unicode Consortium (accessed 2026-09-27)