Text and writing

How to segment text into words, sentences or graphemes

The right unit depends on the task: words help examine terms, while graphemes approximate visible segments.

Before you start

Text is processed in the browser. Consider the content before using it and read the privacy policy.

Privacy

How to use it

  1. Enter Oi! Ola. in Text Segmenter.

  2. Run it with words, then repeat with sentences and graphemes.

  3. Compare the lists, including spaces and punctuation in grapheme mode.

Text Segmenter

Worked example

In the tested browser, word mode finds Oi and Ola; sentence mode separates two sentences; grapheme mode includes the space and punctuation.

Result: 2 words, 2 sentences and 8 graphemes.

Unicode UAX #29

Limits and checks

Word mode includes only segments classified as words. Sentences and graphemes may include spaces or punctuation. Results depend on language, browser and Intl.Segmenter; input is limited to 10,000 UTF-16 code units.

Next step

To count graphemes and compare code points, try Grapheme Counter.

Grapheme Cluster Counter
Back to the blog