Photo by Yosuke Ota on Unsplash

On this page

This chapter follows Dates and Temporal.

The Intl namespace (ECMA-402) provides locale-aware formatting and collation. Engines ship CLDR-based data; you pass BCP 47 locale tags ("de-DE", "en-US", "ja-JP").

Intl.DateTimeFormat

Format instants or Date values for display—time zone and calendar options are explicit.

const fmt = new Intl.DateTimeFormat("de-DE", {
dateStyle: "full",
timeStyle: "short",
timeZone: "Europe/Berlin",
});
fmt.format(new Date("2026-11-01T12:00:00Z"));

Use with Dates and Temporal once you have a definite instant or zoned datetime.

Intl.NumberFormat

Currency, percent, unit, and compact notation:

new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
}).format(1234.5); // "$1,234.50"
new Intl.NumberFormat("de-DE", {
style: "unit",
unit: "kilometer",
}).format(42);

Intl.RelativeTimeFormat

“3 days ago” / “in 2 hours” with plural rules:

const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
rtf.format(-1, "day"); // "yesterday"
rtf.format(2, "hour"); // "in 2 hours"

Intl.Collator

Locale-aware string sort (not plain localeCompare scattered everywhere):

const collator = new Intl.Collator("sv");
["z", "ä", "a"].sort(collator.compare);

Intl.ListFormat

Natural-language joining of arrays:

new Intl.ListFormat("en", { type: "conjunction" }).format([
"HTML",
"CSS",
"JavaScript",
]);
// "HTML, CSS, and JavaScript"

Intl.PluralRules and messages

Choose grammatical plural for a count:

const pr = new Intl.PluralRules("en");
pr.select(1); // "one"
pr.select(2); // "other"

Pair with your message catalog (ICU MessageFormat, i18next, etc.)—Intl does not translate strings by itself.

Locale resolution

Intl.DateTimeFormat().resolvedOptions();
// { locale, calendar, numberingSystem, timeZone, ... }

Pass one locale string, or an array for fallback: ["de-CH", "de", "en"].

Limits

  • Formatting only—translation and copy live in your resource files.
  • Data updates ship with the engine; exotic locales may need polyfills on older runtimes.
  • Intl does not parse arbitrary user date strings; parse with Temporal/Date first, then format.

This is the last chapter in Standard Library. For collection types, start with Arrays in JavaScript.

Search articles

Type a word to search published articles.

Open the search page