This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2020.
* Some parts of this feature may have varying levels of support.
The Intl.Locale object is a standard built-in property of the Intl object that represents a Unicode locale identifier.
const korean = new Intl.Locale("ko", {
script: "Kore",
region: "KR",
hourCycle: "h23",
calendar: "gregory",
});
const japanese = new Intl.Locale("ja-Jpan-JP-u-ca-japanese-hc-h12");
console.log(korean.baseName, japanese.baseName);
// Expected output: "ko-Kore-KR" "ja-Jpan-JP"
console.log(korean.hourCycle, japanese.hourCycle);
// Expected output: "h23" "h12"
The Intl.Locale object was created to allow for easier manipulation of Unicode locales. Unicode represents locales with a string, called a locale identifier. The locale identifier consists of a language identifier and extension tags. Language identifiers are the core of the locale, consisting of language, script, region, and variants subtags. Additional information about the locale is stored in the optional extension tags. Extension tags hold information about locale aspects such as calendar type, clock type, and numbering system type.
Traditionally, the Intl API used strings to represent locales, just as Unicode does. This is a simple and lightweight solution that works well. Adding a Locale class, however, adds ease of parsing and manipulating the language, script, and region, as well as extension tags. The following properties of Intl.Locale correspond to Unicode locale identifier subtags:
| Property | Corresponding subtag |
|---|---|
language | Language ID, first part |
script | Language ID, part after language
|
region | Language ID, part after script
|
variants | Language ID, part after region
|
calendar |
ca (extension) |
caseFirst |
kf (extension) |
collation |
co (extension) |
hourCycle |
hc (extension) |
numberingSystem |
nu (extension) |
numeric |
kn (extension) |
The information above is exactly provided as-is when the Locale object is constructed, without consulting any external database. The Intl.Locale object additionally provides some methods that return information about the locale's real-world information, such as available calendars, collations, and numbering systems.
Intl.Locale()Creates a new Locale object.
These properties are defined on Intl.Locale.prototype and shared by all Intl.Locale instances.
Intl.Locale.prototype.baseNameReturns basic, core information about the Locale in the form of a substring of the complete data string.
Intl.Locale.prototype.calendarReturns the part of the Locale that indicates the Locale's calendar era.
Intl.Locale.prototype.caseFirstReturns whether case is taken into account for the locale's collation rules.
Intl.Locale.prototype.collationReturns the collation type for the Locale, which is used to order strings according to the locale's rules.
Intl.Locale.prototype.constructorThe constructor function that created the instance object. For Intl.Locale instances, the initial value is the Intl.Locale constructor.
Intl.Locale.prototype.hourCycleReturns the time keeping format convention used by the locale.
Intl.Locale.prototype.languageReturns the language associated with the locale.
Intl.Locale.prototype.numberingSystemReturns the numeral system used by the locale.
Intl.Locale.prototype.numericReturns whether the locale has special collation handling for numeric characters.
Intl.Locale.prototype.regionReturns the region of the world (usually a country) associated with the locale.
Intl.Locale.prototype.scriptReturns the script used for writing the particular language used in the locale.
Intl.Locale.prototype.variantsReturns the variants subtags (such as different orthographies) associated with the locale.
Intl.Locale.prototype[Symbol.toStringTag]The initial value of the [Symbol.toStringTag] property is the string "Intl.Locale". This property is used in Object.prototype.toString().
Intl.Locale.prototype.getCalendars()Returns an Array of available calendar identifiers, according to the locale's rules.
Intl.Locale.prototype.getCollations()Returns an Array of the collation types for the Locale.
Intl.Locale.prototype.getHourCycles()Returns an Array of hour cycle identifiers, indicating either the 12-hour clock ("h12"), the Japanese 12-hour clock ("h11"), the 24-hour clock ("h23"), or the unused format "h24".
Intl.Locale.prototype.getNumberingSystems()Returns an Array of numbering system identifiers available according to the locale's rules.
Intl.Locale.prototype.getTextInfo()Returns the part indicating the ordering of characters ltr (left-to-right) or rtl (right-to-left).
Intl.Locale.prototype.getTimeZones()Returns an Array of time zone identifiers, associated with the Locale.
Intl.Locale.prototype.getWeekInfo()Returns UTS 35's Week Elements according to the locale rules.
Intl.Locale.prototype.maximize()Gets the most likely values for the language, script, and region of the locale based on existing values.
Intl.Locale.prototype.minimize()Attempts to remove information about the locale that would be added by calling maximize().
Intl.Locale.prototype.toString()Returns the Locale's full locale identifier string.
At its very simplest, the Intl.Locale() constructor takes a locale identifier string as its argument:
const us = new Intl.Locale("en-US");
The constructor also takes an optional configuration object argument, which can contain any of several extension types. For example, set the hourCycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor:
const us12hour = new Intl.Locale("en-US", { hourCycle: "h12" });
console.log(us12hour.hourCycle); // Prints "h12"
| Desktop | Mobile | Server | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | Bun | Deno | Node.js | |
Locale |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
Locale |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
baseName |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
calendar |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
caseFirst |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
collation |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
getCalendars |
13099Implemented as an accessor property. |
13099Implemented as an accessor property. |
No |
11585Implemented as an accessor property. |
1715.4–previewImplemented as an accessor property. |
13099Implemented as an accessor property. |
No |
8668Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
28.018.0Implemented as an accessor property. |
13099Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
1.0.0 | 1.19 |
24.0.018.0.0Implemented as an accessor property. |
getCollations |
13099Implemented as an accessor property. |
13099Implemented as an accessor property. |
No |
11585Implemented as an accessor property. |
1715.4–previewImplemented as an accessor property. |
13099Implemented as an accessor property. |
No |
8668Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
28.018.0Implemented as an accessor property. |
13099Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
1.0.0 | 1.19 |
24.0.018.0.0Implemented as an accessor property. |
getHourCycles |
13099Implemented as an accessor property. |
13099Implemented as an accessor property. |
No |
11585Implemented as an accessor property. |
1715.4–previewImplemented as an accessor property. |
13099Implemented as an accessor property. |
No |
8668Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
28.018.0Implemented as an accessor property. |
13099Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
1.0.0 | 1.19 |
24.0.018.0.0Implemented as an accessor property. |
getNumberingSystems |
13099Implemented as an accessor property. |
13099Implemented as an accessor property. |
No |
11585Implemented as an accessor property. |
1715.4–previewImplemented as an accessor property. |
13099Implemented as an accessor property. |
No |
8668Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
28.018.0Implemented as an accessor property. |
13099Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
1.0.0 | 1.19 |
24.0.018.0.0Implemented as an accessor property. |
getTextInfo |
13099Implemented as an accessor property. |
13099Implemented as an accessor property. |
No |
11585Implemented as an accessor property. |
1715.4–previewImplemented as an accessor property. |
13099Implemented as an accessor property. |
No |
8668Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
28.018.0Implemented as an accessor property. |
13099Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
1.0.0 | 1.19Implemented as an accessor property. |
24.0.018.0.0Implemented as an accessor property. |
getTimeZones |
13099Implemented as an accessor property. |
13099Implemented as an accessor property. |
No |
11585Implemented as an accessor property. |
1715.4–previewImplemented as an accessor property. |
13099Implemented as an accessor property. |
No |
8668Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
28.018.0Implemented as an accessor property. |
13099Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
1.0.0 | 1.19 |
24.0.018.0.0Implemented as an accessor property. |
getWeekInfo |
13099Implemented as an accessor property. |
13099Implemented as an accessor property. |
No |
11585Implemented as an accessor property. |
1715.4–previewImplemented as an accessor property. |
13099Implemented as an accessor property. |
No |
8668Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
28.018.0Implemented as an accessor property. |
13099Implemented as an accessor property. |
1715.4Implemented as an accessor property. |
1.0.0 |
2.11.19Implemented as an accessor property. |
24.0.018.0.0Implemented as an accessor property. |
hourCycle |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
language |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
maximize |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
minimize |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
numberingSystem |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
numeric |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
region |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
script |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
toString |
74 | 79 | 75 | 62 | 14 | 74 | 79 | 53 | 14 | 11.0 | 74 | 14 | 1.0.0 | 1.8 | 12.0.0 |
variants |
No | No | 141 | No | 26 | No | 141 | No | 26 | No | No | 26 | 1.2.18 | No | No |
Intl.Locale in FormatJSIntl
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale