Intl.PluralRules
new Intl.PluralRules(locale).select(number)
Returns the plural category of a number by the rules of the language. English ordinals have one (1st, 21st), two (2nd), few (3rd) and other (4th, 11th); plain counts have only one and other, other languages up to six categories.
Parameters
- locale – e.g.
'en-US'. - options – optional,
type: 'ordinal'for ordinal numbers (1st, 2nd in English).
Return value
An object; select() returns 'zero', 'one', 'two', 'few', 'many' or 'other'.
Examples
const pr = new Intl.PluralRules('en-US', { type: 'ordinal' });
console.log([0, 1, 2, 3, 4, 11, 22].map((n) => pr.select(n)));
const suffix = { one: 'st', two: 'nd', few: 'rd', other: 'th' };
const nth = (n) => `${n.toLocaleString('en-US')}${suffix[pr.select(n)]}`;
console.log(nth(1), '|', nth(2), '|', nth(13), '|', nth(23));
Output:
[ 'other', 'one', 'two', 'few', 'other', 'other', 'two' ] 1st | 2nd | 13th | 23rd
Things to watch out for
- In English ordinals 11, 12 and 13 are in the
othercategory (11th, 12th, 13th), unlike 21, 22 and 23 (21st, 22nd, 23rd). - The categories differ by language – every language of the site needs its own word forms.
Browser support
Baseline – widely available: in all major browsers since September 2019, considered widely available since March 2022. Since version: Chrome 63, Firefox 58, Safari 13; Node.js 10.0.0. As of October 2026 (MDN browser-compat-data).