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.
PrivacyHow to use it
Enter Oi! Ola. in Text Segmenter.
Run it with words, then repeat with sentences and graphemes.
Compare the lists, including spaces and punctuation in grapheme mode.
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.
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