Skip to content
JavaScript i18n

JavaScript i18n: Browser-Native Internationalization with the Intl API

JavaScript includes the Intl API as a built-in standard for formatting numbers, dates, lists, and handling pluralization rules across locales. No external libraries required. The API is supported in all modern browsers and Node.js, providing locale-sensitive string comparison, segmentation, and relative time formatting out of the box.

JavaScript Intl API Features

Built-in Intl API with no external dependencies for core i18n operations
Intl.NumberFormat for locale-aware currency, percent, and unit formatting
Intl.DateTimeFormat for locale-specific date and time display patterns
Intl.PluralRules for ordinal and cardinal pluralization across 100+ locales
ICU MessageFormat syntax for complex messages with plurals, selects, and nesting
Intl.RelativeTimeFormat for human-readable relative dates (e.g., "3 days ago")
Intl.ListFormat for locale-aware conjunction and disjunction lists
Intl.Collator for locale-sensitive string sorting and comparison
Intl.Segmenter for word, sentence, and grapheme boundary detection

JavaScript Intl API in Practice

Format currencies, dates, and ordinals using built-in Intl constructors with locale-specific output in any modern browser or Node.js runtime.

// Using the built-in Intl API
const formatter = new Intl.NumberFormat('de-DE', {
  style: 'currency',
  currency: 'EUR',
});
console.log(formatter.format(1234.56)); // "1.234,56 €"

// Date formatting
const date = new Intl.DateTimeFormat('ja-JP', {
  year: 'numeric',
  month: 'long',
  day: 'numeric',
});
console.log(date.format(new Date())); // "2026年3月2日"

// Pluralization
const plural = new Intl.PluralRules('en');
const suffixes = { one: 'st', two: 'nd', few: 'rd', other: 'th' };
function ordinal(n) {
  return `${n}${suffixes[plural.select(n)]}`;
}

Start JavaScript i18n Today

Manage your JavaScript translations with AI-powered workflows, CLI sync, and CDN delivery under 50ms.