Intl.ListFormat
Intl.ListFormat formats arrays of items as a human-readable list using locale-aware conjunctions and punctuation. It avoids hand-written separators that sound unnatural in other languages.
Overview
Intl.ListFormat formats arrays of items as a human-readable list using locale-aware conjunctions and punctuation. It avoids hand-written separators that sound unnatural in other languages.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 72 | 79 | 78 | 14.1 | 72 | 14.5 | |
| Built-in object | ||||||
| The Intl.ListFormat() constructor creates Intl.ListFormat objects. | 72 | 79 | 78 | 14.1 | 72 | 14.5 |
| The format() method of Intl.ListFormat instances returns a string with a language-specific representation of the list. | 72 | 79 | 78 | 14.1 | 72 | 14.5 |
| The formatToParts() method of Intl.ListFormat instances returns an array of objects representing each part of the formatted string that would be returned by Intl/ListFormat/format. It is useful for building custom strings from the locale-specific tokens. | 72 | 79 | 78 | 14.1 | 72 | 14.5 |
| The resolvedOptions() method of Intl.ListFormat instances returns a new object with properties reflecting the options computed during initialization of this ListFormat object. | 72 | 79 | 78 | 14.1 | 72 | 14.5 |
| The Intl.ListFormat.supportedLocalesOf() static method returns an array containing those of the provided locales that are supported in list formatting without having to fall back to the runtime's default locale. | 72 | 79 | 78 | 14.1 | 72 | 14.5 |
- Only available on macOS Big Sur (11) and above.
- Only available on macOS Big Sur (11) and above.
- Only available on macOS Big Sur (11) and above.
- Only available on macOS Big Sur (11) and above.
- Only available on macOS Big Sur (11) and above.
- Only available on macOS Big Sur (11) and above.
Syntax
new Intl.ListFormat('ja', { type: 'conjunction' })
.format(['apple', 'banana', 'orange']);
// 'apple, banana, and orange'
new Intl.ListFormat('en', { type: 'conjunction' })
.format(['Apple', 'Banana', 'Orange']);
// 'Apple, Banana, and Orange' Live demo
Use cases
Readable summaries
Format tags, settings, or selected filters into natural language instead of manual comma-joining.
Localized UI copy
Generate conjunctions such as 'A, B, and C' according to locale rules without custom string logic.
Cautions
- ListFormat handles separators and conjunctions, but the surrounding sentence still needs correct grammar and plural logic.
- Long formatted lists may still need truncation or progressive disclosure in constrained layouts.
Accessibility
- Natural list formatting improves screen reader output and makes summary text easier to parse mentally.
Related links
Powered by web-features