JavaScript Intl Methods
About This Index
This page is the JavaScript Intl Methods index. The Intl object exposes constructors and static helpers for locale-aware text. Each row below links to a full guide with syntax, examples you can run, and FAQs.
Learn what Intl is on /js/intl. Use this page when you need a specific API such as NumberFormat or DateTimeFormat.
Write new Intl.NumberFormat("en-US") or Intl.getCanonicalLocales(tags). There is no new Intl(). For newer members, feature-detect with typeof first.
How to Call an Intl Method
Create a formatter with a locale, then format a value:
const d = new Date(Date.UTC(2024, 5, 15, 12, 0, 0));
console.log(new Intl.NumberFormat("en-US").format(1234.5));
console.log(new Intl.DateTimeFormat("en-US", { timeZone: "UTC" }).format(d));
console.log(new Intl.ListFormat("en").format(["A", "B", "C"]));
console.log(Intl.getCanonicalLocales("EN-us").join(", ")); JavaScript Intl Methods Table
All method guides in this JavaScript tutorial series (12 tutorials), grouped by what they do.
Locale helpers
2 methodsNormalize tags and list what the engine supports.
| Method | Description | Tutorial |
|---|---|---|
getCanonicalLocales() | Normalize locale tags to canonical BCP 47 form and drop duplicates. | Open |
supportedValuesOf() | List supported calendars, currencies, time zones, units and more. | Open |
Formatters and collators
9 methodsTurn data into locale text, or compare strings with locale rules.
| Method | Description | Tutorial |
|---|---|---|
Collator | Compare and sort strings with numeric and sensitivity options. | Open |
DateTimeFormat | Format dates and times for a locale and time zone. | Open |
DisplayNames | Turn language, region and currency codes into readable names. | Open |
DurationFormat | Format duration objects such as hours, minutes and seconds. | Open |
ListFormat | Join arrays into lists with and, or, or unit style. | Open |
NumberFormat | Format numbers, currencies and percents. | Open |
PluralRules | Select plural categories such as one and other. | Open |
RelativeTimeFormat | Format relative phrases like 3 days ago. | Open |
Segmenter | Split text into graphemes, words or sentences. | Open |
Locale object
1 methodInspect a locale tag as an object.
Frequently Asked Questions
Start with getCanonicalLocales()
Open the guide for normalizing locale tags: syntax, examples, and FAQs.
13 people found this page helpful
