Pluralization & Localization Preview
Test how numbers, dates, and plural rules are formatted across different languages and regions using the browser's built-in Internationalization (Intl) API.
Plural Category | one |
Pluralization Result | 1 cat |
Formatted Number | 123,456.789 |
Formatted Date | Wednesday, September 10, 2025 |
The Intl object in JavaScript is the namespace for the ECMAScript Internationalization API, which provides language-sensitive string comparison, number formatting, and date and time formatting. It's a powerful, built-in browser feature that allows developers to build applications that can be easily adapted to various languages and regions (localization) without needing large, external libraries. This tool provides a sandbox to explore some of its key features.
Different languages have different rules for pluralization. For example, in English, we have '1 cat' (one) and '2 cats' (other). But other languages have more complex rules. Polish, for instance, has categories for 'one', 'few' (2-4), and 'many' (5+). `Intl.PluralRules` is a constructor for objects that enable language-sensitive pluralization rules. This tool shows you the plural category ('one', 'two', 'few', 'many', 'other', etc.) for a given number and locale, helping you choose the correct string for your interface.
`Intl.NumberFormat` enables language-sensitive number formatting, correctly handling things like decimal separators (e.g., `.` in the US, `,` in Germany) and digit grouping.
`Intl.DateTimeFormat` enables language-sensitive date and time formatting, correctly ordering the day, month, and year and using the correct local names for months and weekdays.