JavaScript Intl.Locale() Constructor

Beginner
6 min read
Updated: Nov 2026
3 examples
Constructor

Definition

new Intl.Locale(tag) turns a locale string into an object with properties such as language, region and script. Methods like maximize() and minimize() fill in or remove likely subtags.

Some engines also expose helpers such as calendars and hourCycles for what that locale commonly uses.

Remember
new Intl.Locale(tag)
loc.language / loc.region / loc.script
loc.maximize() / loc.minimize()

tag example: "ja-JP" or "en-Latn-US"

Syntax

Create a Locale from a tag, then read its parts.

JavaScript
const loc = new Intl.Locale("ja-JP");
console.log(loc.language + "-" + loc.region);
CallWhat it does
new Intl.Locale("ja-JP")Parse Japanese (Japan) into properties.
loc.maximize()Add likely script (and other) subtags.
loc.minimize()Remove subtags that can be inferred.
loc.calendars / loc.hourCyclesCommon calendars and hour cycles when available.

A standard JavaScript constructor on the Intl object: create one with new Intl.Locale(). No import required. Siblings: Intl.getCanonicalLocales(), Intl.supportedValuesOf(), Intl.Collator(), Intl.DateTimeFormat(), Intl.DisplayNames(), Intl.DurationFormat(), Intl.ListFormat(), Intl.NumberFormat(), Intl.PluralRules(), Intl.RelativeTimeFormat(), Intl.Segmenter().

Library declarations
JavaScript
// ECMAScript 2020 β€” Intl.Locale
new Intl.Locale(tag, options)
loc.maximize()
loc.minimize()

// properties: language, script, region, ...
// helpers may include: calendars, hourCycles

Parameters

ParameterDescription
tagRequired. A BCP 47 locale string such as "en-US" or "ja-JP".
optionsOptional. Can override fields such as region or script.

Return Value

Return ValueDescription
Locale objectFrom the constructor, with readable locale fields.
Localemaximize() and minimize() return a new Locale.

JavaScript Examples

Example 1 — Read Language and Region

Parse ja-JP and print the language and region fields.

JavaScript
const loc = new Intl.Locale("ja-JP");

console.log("language: " + loc.language);
console.log("region: " + loc.region);
console.log("tag: " + loc.toString());
Try It Yourself

The Try It page first checks that Intl.Locale exists, because it may be missing in older browsers. In an older browser it prints a short explanation and the output above. In current browsers it runs the code for real.

How It Works

  1. Split the tag. Language is ja, region is JP.
  2. toString. Rebuilds a canonical tag string.
  3. No guessing yet. Script is empty until you maximize.

Example 2 — Add and Remove Likely Subtags

Maximize fills in the likely script. Minimize removes what can be inferred.

JavaScript
const ja = new Intl.Locale("ja-JP").maximize();
const en = new Intl.Locale("en-Latn-US").minimize();

console.log("maximize: " + ja.language + "|" + ja.script + "|" + ja.region);
console.log("minimize: " + en.toString());
Try It Yourself

The Try It page first checks that Intl.Locale exists, because it may be missing in older browsers. In an older browser it prints a short explanation and the output above. In current browsers it runs the code for real.

How It Works

  1. maximize. Japanese in Japan likely uses the Jpan script.
  2. minimize. en-Latn-US can shrink to en when subtags are the likely defaults.
  3. New objects. Both methods return a Locale; they do not mutate the original.

Example 3 — Calendars and Hour Cycles

Read common calendars and hour cycles for Japanese (Japan).

JavaScript
const loc = new Intl.Locale("ja-JP");
const cals = loc.calendars;
const hours = loc.hourCycles;

console.log("calendars: " + cals.slice(0, 2).join(", "));
console.log("hourCycles: " + hours.join(", "));
Try It Yourself

The Try It page first checks that Intl.Locale exists, because it may be missing in older browsers. In an older browser it prints a short explanation and the output above. In current browsers it runs the code for real.

How It Works

  1. calendars. Japan commonly lists Gregorian and Japanese calendars.
  2. hourCycles. h23 means a 0–23 hour clock preference.
  3. Engine data. These helpers describe locale preferences, not a guarantee for every formatter option.

Browser & Runtime Support

Intl.Locale arrived with the Intl.Locale proposal (ES2018–ES2020). Current browsers and Node.js 12+ support it.

✓ ES2020 · Widely supported

Intl.Locale

Supported in Chrome 74+, Edge 79+, Firefox 75+, Safari 14+, Opera 62+ and Node.js 12+.

ES2020 Standard since
Google Chrome 74+ · Desktop & Mobile
Full support
Microsoft Edge 79+ · Chromium based
Full support
Mozilla Firefox 75+ · Desktop & Mobile
Full support
Apple Safari 14+ · macOS & iOS
Full support
Opera 62+ · Chromium based
Full support
Samsung Internet Recent versions · Android
Supported
Android WebView 74+ · Chromium based
Supported
Node.js 12+ · Server runtime
Supported
Deno Supported · JavaScript runtime
Supported
Bun Supported · JavaScript runtime
Supported
Internet Explorer No native support
Not supported
Intl.Locale Excellent

Bottom line: Safe in current browsers. Guard with typeof Intl.Locale === "function" for older engines.

Frequently Asked Questions

It parses a locale tag into properties such as language, region and script, and can maximize or minimize likely subtags.
It adds likely missing subtags, for example the script Jpan for ja-JP.
It removes subtags that can be inferred from likely defaults, which can shorten a tag.
Yes. Intl formatters accept a Locale object or a string tag.
On older engines, check typeof Intl.Locale === "function" before constructing one.

Next: Intl.NumberFormat

Learn how to format numbers, currencies and percents for a locale.

Intl.NumberFormat tutorial →

About the author

Mari Selvan M P
Mari Selvan M P πŸ”—

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful