Skip to main content

Currency Formatter

Format numbers as currency with proper localization

Format numbers as currency strings with proper localization. Display prices correctly for different regions with accurate symbols, decimals, and separators.


How to format numbers as currency?

Currency formatting follows locale-specific conventions that vary dramatically across countries. Here's exactly how to get properly formatted output:

  • Enter the numeric amount you want to format in the input field. You can type whole numbers like 1000, decimals like 99.99, negative values like -50.25, or large values like 1500000.
  • Select your target currency from the dropdown — choose from all ISO 4217 codes including USD (US Dollar), EUR (Euro), JPY (Japanese Yen), VND (Vietnamese Dong), and over 200 others.
  • Choose a locale/region for formatting conventions. The locale determines decimal separators, thousands separators, and currency symbol placement. For example, en-US formats as '$1,234.56' while de-DE formats as '1.234,56 €' while vi-VN formats as '1.234,56 ₫'.
  • Optionally adjust minimum and maximum decimal places. Most currencies use 2 decimals, but Japanese Yen uses 0, Kuwaiti Dinar uses 3, and Vietnamese Dong typically uses 0 despite having subunits.
  • Copy the formatted string using the copy icon. The result is ready to paste into invoices, reports, UI mockups, or code files with correct localization applied.

Related Tools

You May Also Need

Why currency formatting varies so much across locales

The Intl.NumberFormat API (part of ECMAScript Internationalization API) handles currency formatting by consulting Unicode CLDR (Common Locale Data Repository) data for each locale. This data encodes country-specific rules that go far beyond simple symbol substitution. In the US, the dollar sign precedes the number with no space ($100). In France, there's a non-breaking space between the number and euro sign (100 €). In Germany, commas separate thousands and periods separate decimals (1.234,56 €). In India, the lakhs system groups digits differently after the first three: 1,23,456.78 instead of 123,456.78. Some locales like Switzerland use multiple currency symbols depending on the region (CHF for German-speaking, Franc Suisse for French-speaking). The currency display symbol option shows localized symbols (€ vs EUR), while the code option always shows the ISO code. Understanding these nuances prevents embarrassing mistakes in international applications — displaying '1.000.000 €' to a German user clearly means one million euros, but an American reader might interpret it as one thousand euros.

Common pitfalls when formatting currency in applications

  • Rounding errors: JavaScript's floating-point arithmetic can produce results like 19.995000000000002. Always round to the appropriate decimal places before formatting — use Math.round(value * 100) / 100 for 2-decimal currencies.
  • Zero-decimal currencies: JPY, KRW, VND, and several others don't use fractional units. Formatting 1000 JPY with 2 decimal places produces '¥1,000.00' which looks unprofessional. Set minimumFractionDigits and maximumFractionDigits to 0 for these currencies.
  • Negative number display: Different locales place the minus sign differently. en-US shows '-$100', fr-FR shows '-100,00 €', and some Asian locales may use a leading minus without space. Let the locale handle this automatically rather than hardcoding.
  • Currency symbol vs code: Using style:'currency' shows the localized symbol (€), while style:'decimal' with currencyCode shows the ISO code (EUR). Choose based on your audience — consumer-facing apps benefit from symbols, while backend systems often prefer codes.
  • Missing locale support: Not all browsers implement full ICU data. Older browsers or minimal builds may fall back to default formatting. Test your target locales across browsers, especially for right-to-left locales like ar-SA where the currency symbol appears on the left.

Frequently Asked Questions (FAQs)

What currencies are supported by this formatter?

All ISO 4217 currency codes are supported, covering 160+ currencies worldwide. This includes major currencies (USD, EUR, GBP, JPY, CNY, INR), precious metals (XAU for gold, XAG for silver), and special drawing rights (XDR). The formatter uses your browser's built-in Intl.NumberFormat, which covers the same currency set as modern web standards.

What does 'locale' mean in currency formatting?

A locale combines language and region to define formatting conventions. 'en-US' means English as used in the United States (dollar sign first, comma for thousands, period for decimals). 'vi-VN' means Vietnamese as used in Vietnam (dong symbol last, period for thousands, comma for decimals). 'ar-SA' means Arabic as used in Saudi Arabia (right-to-left text, Eastern Arabic numerals potentially). The locale controls everything except the currency itself.

Can I customize the number of decimal places?

Yes! You can set minimumFractionDigits and maximumFractionDigits independently. Most currencies default to 2 decimals, but you can override this. For Japanese Yen, set both to 0. For Kuwaiti Dinar (highest-valued currency at ~3.25 USD per KD), you might want 3 decimals. For microtransactions in Bitcoin pricing, you could use 8 decimals.

Why does my formatted currency look different in different browsers?

Browser implementations of Intl.NumberFormat rely on the underlying operating system's ICU (International Components for Unicode) library. Chrome and Edge use Chromium's ICU, Firefox bundles its own, and Safari uses macOS's ICU. Minor differences can appear in symbol spacing or digit shaping for certain locales. These differences are usually cosmetic and reflect legitimate regional variations.

How do I format currency in my JavaScript code using these patterns?

Use the native Intl.NumberFormat constructor: new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(1234.56) returns '$1,234.56'. You can cache formatter instances for performance since creating them is relatively expensive. For server-side Node.js, the 'intl' polyfill provides the same API.

Does this tool store any of my formatted data?

No. All formatting happens entirely in your browser using JavaScript's Intl.NumberFormat API. No data is sent to any server, stored in cookies, or logged anywhere. Your numbers and formatting choices remain completely private.

Recently Used Tools