PACKAGE · INTERNATIONALIZATION

@formatjs/intl

Internationalize JS apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.

WEEKLY DOWNLOADS 2.8M
STARS 14.7K
FORKS 1.4K
OPEN ISSUES 7
GZIP SIZE 12.9 kB
UNPACKED SIZE 90.6 kB
DEPENDENCIES 5
LAST UPDATED 6mo ago
DOWNLOAD TRENDS

@formatjs/intl downloads — last 12 months

Download trends for @formatjs/intl1 download series from Aug 2025 to Jul 2026. Use left and right arrow keys to inspect monthly values.04.0M7.9M11.9M15.8MAug 2025NovFebMayJul 2026
@formatjs/intl
ABOUT @FORMATJS/INTL

@formatjs/intl provides a comprehensive suite of tools for internationalizing JavaScript applications, addressing the complexities of presenting localized content to users worldwide. It enables developers to format dates, numbers, and strings according to specific locales, handling all the nuances of different cultural conventions and grammatical rules. This is crucial for creating user experiences that feel native and respectful across diverse global audiences, moving beyond simple text replacements to true localization.

With a core philosophy centered on robust i18n standards and developer ergonomics, @formatjs/intl is designed for applications that require a high degree of control and accuracy in their internationalization efforts. Its primary audience includes developers working on web applications, particularly those using modern JavaScript frameworks and targeting a global user base. The library aims to map directly to CLDR (Common Locale Data Repository) data, ensuring accurate and up-to-date formatting rules.

The package offers a declarative approach to formatting through components and hooks, such as `<FormattedMessage>` and `useIntl`. These abstractions simplify the integration of translated messages, date/time formatting, and number formatting directly within your UI components. Pluralization rules, gender-specific translations, and rich message syntax are all supported, allowing for dynamic and context-aware content generation.

@formatjs/intl integrates seamlessly into various JavaScript ecosystems, including React, Next.js, and other frameworks, via its specialized sub-packages like `@formatjs/react-intl`. It plays well with common translation management workflows and build tools, facilitating the extraction of messages and the integration of compiled translation files. The library is extensible, allowing custom formatters and integrations.

Weighing in at a modest 12.9 kB (gzipped), @formatjs/intl offers significant internationalization capabilities without imposing a heavy performance burden. Its maturity, evidenced by 14.7K GitHub stars and a consistent update history, speaks to its reliability for production applications. The active community and ongoing development ensure that it remains a relevant and well-supported choice for i18n needs.

Developers should be aware that while powerful, @formatjs/intl has a learning curve associated with its rich feature set, especially concerning complex message formatting and custom pluralization rules. Setting up extraction tools for translation management requires configuration. For extremely simple cases with only a few hardcoded English strings, its comprehensive features might introduce unnecessary complexity.

WHEN TO USE
  • When formatting dates and numbers according to specific locale conventions, using APIs like `formatDate` and `formatNumber`.
  • When implementing complex pluralization logic in messages, leveraging the `plural` format specifier within message strings.
  • When displaying localized string messages using the `<FormattedMessage>` component or the `formatMessage` hook in React applications.
  • When integrating with translation management systems that require message extraction and compilation.
  • When building applications that adhere to the Unicode CLDR standard for locale data.
  • When requiring support for rich message formatting, including ICU Message syntax for dynamic content.
  • When developing applications where managing translations across multiple languages is a primary requirement.
WHEN NOT TO USE
  • If only simple key-value string replacements are needed, consider using built-in JavaScript string manipulation or a more minimal library.
  • If the application targets a single language and requires no localization, the overhead of @formatjs/intl may not be justified.
  • When dealing with extremely small, static message sets where manual string interpolation suffices.
  • If performance is critically constrained and even a 12.9 kB (gzipped) bundle is too impactful, explore alternatives with significantly reduced feature sets.
  • For simple form inputs that only require basic validation without multi-language support.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 3
@formatjs/intl vs i18next ★ 8.6K · 16.8M/wk @formatjs/intl vs @lingui/core ★ 5.8K · 1.2M/wk @formatjs/intl vs next-intl ★ 4.3K · 4.1M/wk