Intl.supportedValuesOf()

Discover what internationalization features are supported in any JavaScript environment. Learn to work with calendars, currencies, units, time zones, and numbering systems.

What Is Intl.supportedValuesOf()?

The Intl.supportedValuesOf() static method returns an array containing the supported calendar, collation, currency, numbering system, time zone, or unit values supported by the JavaScript implementation. This API is essential for building flexible, locale-aware applications that gracefully handle varying levels of internationalization support.

Key capabilities:

  • Feature detection for internationalization support
  • Dynamic discovery of available calendar types
  • Currency and unit formatting options
  • Time zone and numbering system discovery

As global audiences increasingly expect personalized digital experiences, the ability to programmatically discover what internationalization features are available becomes critical for web development teams building applications that serve users worldwide. The ECMAScript Internationalization API specification, maintained by TC39, introduced this capability to enable developers to create truly adaptive solutions that work across different browser environments and runtime configurations.

The API achieved Baseline status in March 2022, meaning it works consistently across Chrome, Edge, Firefox, and Safari, making it safe for production use without polyfill concerns for the vast majority of users. This standardization enables progressive enhancement strategies where applications can load internationalization polyfills only when necessary, reducing bundle sizes and improving initial page load performance for users who don't need advanced localization features.

For businesses targeting international markets, proper implementation of these APIs supports international SEO efforts by ensuring search engines can properly parse and index localized content across different date formats, number conventions, and regional preferences.

Six Categories of Supported Values

Intl.supportedValuesOf() exposes internationalization capabilities across these key areas

Calendar Types

Discover supported calendars: gregory, japanese, islamic-umalqura, chinese, hebrew, buddhist, and more for global date formatting.

Numbering Systems

Access numbering systems like arab, latn, hans, hant, deva, and beng for culturally appropriate number representation.

Currency Codes

Get ISO 4217 currency identifiers for dynamic currency formatting and financial application support.

Time Zones

Discover IANA time zones for displaying times across global locations accurately.

Measurement Units

Access units for length, mass, time, temperature, and digital measurements with proper formatting.

Collation Types

Find string sorting and comparison rules for language-specific text ordering.

Syntax and Parameters

The method follows a straightforward syntax:

Intl.supportedValuesOf(key)

Parameters

The key parameter accepts one of six string values:

KeyDescription
"calendar"Supported calendar identifiers
"collation"Supported string collation types
"currency"Supported ISO 4217 currency codes
"numberingSystem"Supported numbering system identifiers
"timeZone"Supported IANA time zone identifiers
"unit"Supported measurement unit identifiers

Return Value

Returns a sorted array of unique string values. The array is sorted in ascending lexicographical order, with duplicates omitted.

Locale-Unaware Nature

It's important to understand that Intl.supportedValuesOf() is locale-unaware, meaning it returns identifiers that may be supported across the implementation without filtering based on specific locale preferences. This design reflects the method's purpose of exposing the underlying capabilities of the internationalization implementation rather than suggesting preferences for any particular locale. If you need to determine preferred values for a specific locale, you would use the Intl.Locale object with methods like Intl.Locale.prototype.getCalendars() instead. This distinction is crucial when building localization configuration interfaces that need to present users with accurate choices based on their regional settings.

Implementing robust localization requires careful consideration of both the technical capabilities and user experience design. Partnering with experienced web development teams ensures these features are properly integrated into your applications.

Basic Syntax
1// Get all supported values by category2const calendars = Intl.supportedValuesOf("calendar");3const currencies = Intl.supportedValuesOf("currency");4const units = Intl.supportedValuesOf("unit");5const timeZones = Intl.supportedValuesOf("timeZone");6const numberingSystems = Intl.supportedValuesOf("numberingSystem");7const collations = Intl.supportedValuesOf("collation");8 9// Example output10console.log(calendars.slice(0, 5));11// ["buddhist", "chinese", "coptic", "dangi", "ethioaa"]

Working with Calendar Types

The calendar support reveals diverse calendar systems used globally. Modern applications need multiple calendar support to serve international audiences effectively, whether displaying dates for users in Japan who prefer the imperial era system, users in Middle Eastern countries who use Islamic calendars, or users in East Asian regions who follow traditional lunisolar systems.

Common Calendar Types

  • gregory - International standard Gregorian calendar
  • japanese - Japanese Imperial calendar with eras
  • islamic-umalqura - Islamic calendar (Umm al-Qura, Saudi Arabia)
  • chinese - Traditional Chinese lunisolar calendar
  • hebrew - Traditional Hebrew calendar
  • buddhist - Thai Buddhist calendar

Practical Example

// Get supported calendars
const calendars = Intl.supportedValuesOf("calendar");

// Format date using Japanese calendar
const jpFormatter = new Intl.DateTimeFormat("ja-JP", {
 calendar: "japanese",
 year: "numeric",
 month: "long",
 day: "numeric",
 era: "long"
});

console.log(jpFormatter.format(new Date()));
// "2025年1月9日 令和7年"

Best Practices for Calendar Selection

When implementing calendar support in your application, always validate whether a calendar is supported before attempting to use it. Store user calendar preferences persistently and apply them consistently across all date formatting operations. Consider presenting calendar options with both technical identifiers and human-readable descriptions to improve usability. For financial or scheduling applications serving diverse regions, implement fallback mechanisms that default to the Gregorian calendar when a user's preferred system isn't available, ensuring the application remains functional regardless of the user's locale settings.

Formatting Units with Intl

The Intl.NumberFormat API with style: "unit" provides powerful unit formatting that handles pluralization and locale conventions automatically. This capability is particularly valuable for applications that need to display measurements in user-preferred formats or allow users to work with various unit systems across different regions.

Supported Unit Categories

Length: meter, foot, inch, kilometer, mile, centimeter, millimeter

Mass: kilogram, gram, pound, ounce, stone

Time: second, minute, hour, day, week, month, year

Temperature: celsius, fahrenheit

Digital: bit, byte, kilobyte, megabyte, gigabyte, terabyte

Area: acre, hectare

Display Options

The unitDisplay option controls how units appear: long provides full spelling ("5 kilometers"), short" uses abbreviations ("5 km"), and narrow` offers the most compact form ("5km"). Choose the appropriate display style based on your UI context and available space. For mobile interfaces or data tables where space is limited, narrow formatting often works best, while long format improves clarity in instructional content or detailed specifications.

File size formatting demonstrates a common use case where automatic handling of unit conversion and appropriate formatting saves development time while ensuring consistency across your application. When displaying upload progress, download statistics, or storage capacity, let Intl.NumberFormat handle the complexity of choosing appropriate units and formatting values correctly.

Unit Formatting Examples
1// Basic unit formatting2const lengthFormatter = new Intl.NumberFormat("en-US", {3 style: "unit",4 unit: "kilometer",5 unitDisplay: "long"6});7console.log(lengthFormatter.format(5));8// "5 kilometers"9 10// Narrow format for compact display11const narrowFormatter = new Intl.NumberFormat("en-US", {12 style: "unit",13 unit: "kilometer",14 unitDisplay: "narrow"15});16console.log(narrowFormatter.format(5));17// "5km"18 19// Temperature formatting20const tempFormatter = new Intl.NumberFormat("en-US", {21 style: "unit",22 unit: "celsius",23 unitDisplay: "short"24});25console.log(tempFormatter.format(25));26// "25°C"27 28// File size formatting29const fileFormatter = new Intl.NumberFormat("en-US", {30 style: "unit",31 unit: "megabyte",32 unitDisplay: "short"33});34console.log(fileFormatter.format(2.5));35// "2.5MB"

Currency Formatting

The Intl.supportedValuesOf("currency") method returns ISO 4217 currency codes supported by the implementation. This enables e-commerce applications and financial platforms to present currency selection options dynamically rather than hardcoding currency lists that may become outdated or incomplete over time.

Currency Formatting Features

  • Automatic currency symbol placement based on locale
  • Locale-appropriate decimal formatting (EUR uses comma as decimal separator)
  • Currency code display options for currencies without symbols
  • Proper handling of zero-decimal currencies like JPY that don't use fractional units

Best Practices for E-commerce

When building currency selection in e-commerce applications, implement a mapping between locales and their common currencies to provide sensible defaults. Always validate that a selected currency is actually supported before attempting to format amounts, and provide clear feedback when a user's preferred currency isn't available. Consider caching the list of supported currencies at the module level to avoid repeated method calls, and use Object.freeze() to prevent accidental modification. For applications serving international markets, allow users to select their display currency independently of their browsing locale, enabling price comparisons across different currency systems.

Implementing proper internationalization for e-commerce platforms improves conversion rates and customer trust. Our web development services include comprehensive localization implementation for global e-commerce deployments.

Currency Formatting
1// Get supported currencies2const currencies = Intl.supportedValuesOf("currency");3 4// Format different currencies5function formatCurrency(amount, currency, locale = "en-US") {6 return new Intl.NumberFormat(locale, {7 style: "currency",8 currency: currency9 }).format(amount);10}11 12console.log(formatCurrency(99.99, "USD"));13// "$99.99"14 15console.log(formatCurrency(99.99, "EUR"));16// "99,99 €"17 18console.log(formatCurrency(99.99, "JPY"));19// "¥100" (no decimals)20 21console.log(formatCurrency(99.99, "GBP"));22// "GBP99.99"

Time Zone Discovery

The Intl.supportedValuesOf("timeZone") method returns IANA time zone identifiers for displaying times across global locations accurately. For applications that schedule meetings across time zones, display international shipping estimates, or simply show users the current time in different locations, this capability ensures accurate and consistent date/time formatting.

Common Time Zone Operations

  • Discovering available time zones dynamically
  • Formatting dates for specific geographic locations
  • Building time zone selection dropdowns
  • Handling daylight saving time transitions automatically

Organizing Large Time Zone Lists

The list of supported time zones can be extensive, with hundreds of entries representing cities and regions worldwide. When building user interfaces for time zone selection, organize the list hierarchically by continent/region to make navigation manageable. Extract unique regions from time zone strings using split("/")[0] to create a navigable category structure. For improved user experience, highlight the user's current time zone as the default selection and provide search functionality for quick access to commonly used time zones.

The relationship between time zones and locale preferences is significant but distinct--while a user's locale may suggest a default time zone, they often need independent control over each setting. International travelers may prefer seeing times in their home time zone while browsing in a local language, while expatriates may want local time displayed while keeping their interface in their native language. Building flexible timezone handling into your web applications from the start ensures these use cases are supported without architectural changes later.

Numbering Systems

The Intl.supportedValuesOf("numberingSystem") method reveals diverse numeral systems used across cultures for culturally appropriate number representation. Supporting multiple numbering systems enables applications to present numbers in familiar, culturally appropriate formats that match users' expectations based on their language and regional preferences.

Common Numbering Systems

  • latn - Western/Latin numerals (0-9)
  • arab - Arabic-Indic numerals
  • hans - Chinese simplified numerals
  • hant - Chinese traditional numerals
  • deva - Devanagari numerals (Hindi, Marathi)
  • beng - Bengali numerals

Accessibility Considerations

When implementing numbering system support, consider accessibility requirements for users who may need to switch between numeral systems. Some users with dyslexia or certain cognitive differences may find certain numeral systems easier to read. Ensure that the numbering system selection is persistent across sessions and clearly visible so users can verify their current setting. For form inputs, validate that user-entered numbers are displayed correctly in their preferred system, maintaining consistency between input and display formats.

Numbering System Examples
1// Get supported numbering systems2const systems = Intl.supportedValuesOf("numberingSystem");3 4// Format number with different systems5function formatWithSystem(value, locale, system) {6 return new Intl.NumberFormat(locale, {7 numberingSystem: system8 }).format(value);9}10 11// Format 12345.67 in different systems12console.log(formatWithSystem(12345.67, "en-US", "latn"));13// "12,345.67"14 15console.log(formatWithSystem(12345.67, "hi-IN", "deva"));16// "१२,३४५.६७" (Devanagari)17 18// Get user's default numbering system19const userLocale = navigator.language;20const userNumbering = new Intl.NumberFormat(userLocale).resolvedOptions().numberingSystem;

Best Practices

Feature Detection

Use Intl.supportedValuesOf() for feature detection to enable progressive enhancement. This approach supports applications that need to work across different browser capabilities while providing enhanced features when supported:

function isCalendarSupported(calendar) {
 return Intl.supportedValuesOf("calendar").includes(calendar);
}

function isUnitSupported(unit) {
 return Intl.supportedValuesOf("unit").includes(unit);
}

Performance Optimization

Cache supported values at module level to avoid repeated calls. The values don't change during runtime, so computing them once and reusing the results improves performance significantly:

// Cache at module load
const SUPPORTED_CALENDARS = Object.freeze(Intl.supportedValuesOf("calendar"));
const SUPPORTED_UNITS = Object.freeze(Intl.supportedValuesOf("unit"));
const SUPPORTED_CURRENCIES = Object.freeze(Intl.supportedValuesOf("currency"));

Error Handling

The method throws RangeError for invalid keys, so proper error handling is essential:

function safelyGetSupportedValues(key) {
 const validKeys = ["calendar", "collation", "currency", 
 "numberingSystem", "timeZone", "unit"];
 
 if (!validKeys.includes(key)) {
 throw new RangeError(`Invalid key: "${key}"`);
 }
 
 try {
 return Intl.supportedValuesOf(key);
 } catch (error) {
 console.error("Failed to get supported values:", error);
 return [];
 }
}

Browser Compatibility

The API is widely available (Baseline since March 2022) across Chrome, Edge, Firefox, Safari, and Node.js 18+. For older browser environments, implement feature detection and provide fallback values for commonly used options.

Organizations looking to implement comprehensive internationalization across their digital properties can benefit from our AI automation services which can help manage localization workflows and content translation at scale.

Integration with Next.js

When using Intl.supportedValuesOf() in Next.js applications, values are determined by the Node.js runtime environment rather than the browser. This distinction is important for applications that need to present identical options to all users regardless of their browser--server-side determination ensures consistency across the user base.

Server-Side vs Client-Side Considerations

For optimal performance in Next.js applications, compute supported values on the server and cache them for reuse across requests. Use React's cache() function to memoize these computations and prevent redundant work. In client components, detect feature availability before attempting to use the API, providing graceful fallbacks for environments where it isn't supported.

React Hook Implementation

Creating a custom hook encapsulates internationalization logic and improves code organization:

import { useMemo } from 'react';

export function useIntlSupport() {
 return useMemo(() => {
 if (typeof Intl === "undefined" || !Intl.supportedValuesOf) {
 return null;
 }
 
 return {
 calendars: Intl.supportedValuesOf("calendar"),
 units: Intl.supportedValuesOf("unit"),
 currencies: Intl.supportedValuesOf("currency"),
 timeZones: Intl.supportedValuesOf("timeZone"),
 numberingSystems: Intl.supportedValuesOf("numberingSystem")
 };
 }, []);
}

For React applications built with Next.js, this hook pattern provides clean separation of concerns while ensuring internationalization features are discovered efficiently. Server components can pre-compute supported values and pass them as props, while client components can use the hook to access this data without duplicating work.

Frequently Asked Questions

Conclusion

The Intl.supportedValuesOf() API provides essential capabilities for building globally-aware JavaScript applications. By enabling programmatic discovery of supported internationalization features, it empowers developers to create adaptive experiences that serve users worldwide with consistent, culturally appropriate formatting.

Key takeaways:

  1. Feature Detection: Use it to determine available internationalization capabilities before attempting to use specific features
  2. Dynamic UIs: Build user interfaces that adapt to actual browser and runtime capabilities rather than hardcoded assumptions
  3. Progressive Enhancement: Load polyfills only when necessary, reducing bundle size and improving performance
  4. Performance: Cache results at module level and avoid repeated method calls
  5. Error Handling: Validate keys and handle RangeError exceptions gracefully

With broad browser support since March 2022 and availability in Node.js 18+, Intl.supportedValuesOf() is ready for production use in modern web applications. Whether you're building e-commerce platforms that need robust currency formatting, scheduling applications that must handle multiple calendar systems, or any application serving international audiences, this API provides the foundation for truly global JavaScript implementations.

Build Global Web Applications

Our team specializes in building internationalized web applications that serve users worldwide with performance and accessibility in mind.

Sources

  1. MDN Web Docs - Intl.supportedValuesOf() - Comprehensive official documentation covering syntax, parameters, return values, and browser compatibility
  2. MDN Web Docs - Intl.NumberFormat - Number formatting options including unit and currency styling
  3. Raymond Camden - Unit Formatting with Intl in JavaScript - Practical developer tutorial demonstrating unit formatting use cases
  4. TC39 ECMAScript Internationalization API Specification - Official ECMAScript standard defining the Internationalization API specification