JavaScript Intl.DisplayNames() Constructor

Beginner
5 min read
Updated: Nov 2026
3 examples
Constructor

Definition

new Intl.DisplayNames(locales, options) builds a helper that turns codes into human-readable names. Set options.type to "language", "region" or "currency" (and other types), then call of(code).

The locale of the DisplayNames object chooses the language of the label: English DisplayNames say "French", French DisplayNames say "anglais" for English.

Remember
new Intl.DisplayNames(locales, { type })
names.of(code)

type: "language" | "region" | "currency" | ...
of("fr") → "French" in en

Syntax

Create DisplayNames with a type, then call of with a code.

JavaScript
const languages = new Intl.DisplayNames(["en"], { type: "language" });
console.log(languages.of("fr"));
CallWhat it does
new Intl.DisplayNames(["en"], { type: "language" })English labels for language codes.
names.of("fr")The display name for French.
{ type: "region" }Country / region codes such as "US".
{ type: "currency" }Currency codes such as "JPY".

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

Library declarations
JavaScript
// ECMAScript 2021 — Intl.DisplayNames
new Intl.DisplayNames(locales, options)
names.of(code)

// options.type : "language" | "region" | "currency" | ...
// of returns   : string | undefined

Parameters

ParameterDescription
localesLocale(s) for the language of the labels, such as "en" or "fr".
optionsRequired for practical use. Must include type.
codeFor of: a language, region or currency code matching the type.

Return Value

Return ValueDescription
DisplayNames objectFrom the constructor.
stringFrom of when a name is found.
undefinedWhen no display name exists for that code (depending on options).

JavaScript Examples

Example 1 — Language Names in English and French

Look up language codes and print names in two label languages.

JavaScript
const en = new Intl.DisplayNames(["en"], { type: "language" });
const fr = new Intl.DisplayNames(["fr"], { type: "language" });

console.log("en of fr: " + en.of("fr"));
console.log("fr of en: " + fr.of("en"));
Try It Yourself

The Try It page first checks that Intl.DisplayNames exists, because it is new in ES2021. 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. Type language. Codes like "fr" and "en" are language tags.
  2. Label locale. The constructor locale chooses English or French wording.
  3. of(code). Returns the readable name for that code.

Example 2 — Region Names for US

Turn the region code US into a country name in English and French.

JavaScript
const en = new Intl.DisplayNames(["en"], { type: "region" });
const fr = new Intl.DisplayNames(["fr"], { type: "region" });

console.log("en: " + en.of("US"));
console.log("fr: " + fr.of("US"));
Try It Yourself

The Try It page first checks that Intl.DisplayNames exists, because it is new in ES2021. 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. Type region. Use two-letter region codes such as "US".
  2. Localized labels. French uses États-Unis for the same code.
  3. UI lists. Handy for country pickers without hard-coding translations.

Example 3 — Currency Names for JPY

Show the Japanese Yen name in English and French.

JavaScript
const en = new Intl.DisplayNames(["en"], { type: "currency" });
const fr = new Intl.DisplayNames(["fr"], { type: "currency" });

console.log("en: " + en.of("JPY"));
console.log("fr: " + fr.of("JPY"));
Try It Yourself

The Try It page first checks that Intl.DisplayNames exists, because it is new in ES2021. 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. Type currency. Pass ISO currency codes such as "JPY".
  2. Full names. DisplayNames gives words, while NumberFormat can show symbols and amounts.
  3. Two locales. The same code reads differently in English and French.

Browser & Runtime Support

Intl.DisplayNames is part of ES2021. Current browsers and Node.js 14+ support it.

✓ ES2021 · Widely supported

Intl.DisplayNames

Supported in Chrome 81+, Edge 81+, Firefox 86+, Safari 14.1+, Opera 68+ and Node.js 14+.

ES2021 Standard since
Google Chrome 81+ · Desktop & Mobile
Full support
Microsoft Edge 81+ · Chromium based
Full support
Mozilla Firefox 86+ · Desktop & Mobile
Full support
Apple Safari 14.1+ · macOS & iOS
Full support
Opera 68+ · Chromium based
Full support
Samsung Internet Recent versions · Android
Supported
Android WebView 81+ · Chromium based
Supported
Node.js 14+ · Server runtime
Supported
Deno Supported · JavaScript runtime
Supported
Bun Supported · JavaScript runtime
Supported
Internet Explorer No native support
Not supported
Intl.DisplayNames Excellent

Bottom line: Safe in current browsers. Guard with typeof Intl.DisplayNames === "function" when supporting older Node or browsers.

Frequently Asked Questions

It turns codes for languages, regions, currencies and similar keys into readable names in a chosen language.
Common types are language, region and currency. Engines may also support script, calendar, dateTimeField and others.
A string display name, or undefined when nothing is available for that code.
No. DisplayNames names the currency. NumberFormat formats an amount with a currency style.
Yes on older engines. Check typeof Intl.DisplayNames === "function" before using it.

Next: Intl.DurationFormat

Learn how to format durations such as 1 hour 30 minutes.

Intl.DurationFormat 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.

12 people found this page helpful