Get to know MDN better
Since April 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The Intl.Segmenter object enables locale-sensitive text segmentation, enabling you to get meaningful items (graphemes, words or sentences) from a string.
Creates a new Intl.Segmenter object.
Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
These properties are defined on Intl.Segmenter.prototype and shared by all Intl.Segmenter instances.
Intl.Segmenter.prototype.constructorThe constructor function that created the instance object. For Intl.Segmenter instances, the initial value is the Intl.Segmenter constructor.
Intl.Segmenter.prototype[Symbol.toStringTag]The initial value of the [Symbol.toStringTag] property is the string "Intl.Segmenter". This property is used in Object.prototype.toString().
Returns a new object with properties reflecting the locale and granularity options computed during initialization of this Intl.Segmenter object.
Intl.Segmenter.prototype.segment()Returns a new iterable Segments instance representing the segments of a string according to the locale and granularity of this Intl.Segmenter instance.
If we were to use String.prototype.split(" ") to segment a text in words, we would not get the correct result if the locale of the text does not use whitespaces between words (which is the case for Japanese, Chinese, Thai, Lao, Khmer, Myanmar, etc.).
| ECMAScript® 2027 Internationalization API Specification # segmenter-objects |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 20, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.