Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
The Intl.Collator object enables language-sensitive string comparison.
Creates a new Collator 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.Collator.prototype and shared by all Intl.Collator instances.
Intl.Collator.prototype.constructorThe constructor function that created the instance object. For Intl.Collator instances, the initial value is the Intl.Collator constructor.
Intl.Collator.prototype[Symbol.toStringTag]The initial value of the [Symbol.toStringTag] property is the string "Intl.Collator". This property is used in Object.prototype.toString().
Getter function that compares two strings according to the sort order of this Intl.Collator object.
Intl.Collator.prototype.resolvedOptions()Returns a new object with properties reflecting the locale and collation options computed during initialization of the object.
The following example demonstrates the different potential results for a string occurring before, after, or at the same level as another:
Note that the results shown in the code above can vary between browsers and browser versions. This is because the values are implementation-specific. That is, the specification requires only that the before and after values are negative and positive.
The results provided by Intl.Collator.prototype.compare() vary between languages. In order to get the sort order of the language used in the user interface of your application, make sure to specify that language (and possibly some fallback languages) using the locales argument:
The results provided by Intl.Collator.prototype.compare() can be customized using the options argument:
| ECMAScript® 2027 Internationalization API Specification # collator-objects |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 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.