The Intl (Internationalization) object in JavaScript helps format data — numbers, dates, lists, and text — for specific locales.
Intl.NumberFormatconst amount = 1234567.89;
const jpy = new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' });
console.log(jpy.format(amount)); // ¥1,234,568
Intl.DateTimeFormatconst now = new Date();
const enUS = new Intl.DateTimeFormat('en-US', { dateStyle: 'full', timeStyle: 'long' });
console.log(enUS.format(now)); // Friday, July 21, 2025 at 7:05:00 PM GMT+05:30
Intl.Collatorconst words = ['résumé', 'repertoire', 'resume'];
const deSort = new Intl.Collator('de-DE');
console.log(words.slice().sort(deSort.compare)); // German sorting
Intl.RelativeTimeFormatconst rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto', style: 'long' });
console.log(rtf.format(-1, 'day')); // yesterday
console.log(rtf.format(-3, 'month')); // 3 months ago
console.log(rtf.format(5, 'quarter')); // in 5 quarters
Intl.ListFormatconst items = ['Motorcycle', 'Bus', 'Car'];
const enList = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' });
console.log(enList.format(items)); // Motorcycle, Bus, and Car
Intl.PluralRulesconst plural = new Intl.PluralRules('en-US');
console.log(plural.select(1)); // one
console.log(plural.select(2)); // other
console.log(plural.select(0.5)); // other