Number Formatter

Format numbers and currencies for any locale with Intl

Result
–

Code

Same number in other locales

How to format numbers for any locale

  1. Enter a number, using a dot for decimals.
  2. Choose the locale, for example en-US, de-DE or en-IN, and a style: plain decimal, currency, percent, compact (1.2M), scientific, units such as km/h, or file sizes.
  3. Set the minimum and maximum decimal places and digit grouping.
  4. Copy the result, or copy the JavaScript Intl.NumberFormat code that produces it. The table shows the same number in 20 locales.

Why number formatting is tricky

Conventions differ around the world. The US writes 1,234,567.89, Germany 1.234.567,89, France 1 234 567,89 with narrow spaces, Switzerland 1’234’567.89 and India groups in lakhs and crores as 12,34,567.89. Currency symbols go before or after the number, with or without a space, and some currencies such as the Japanese yen have no decimal places. Getting this wrong confuses customers and can even make prices look ten or a thousand times off.

The browser's built-in Intl.NumberFormat API handles all of this using the Unicode CLDR data, so the code you copy here works in every modern browser and in Node.js without a library. Always format numbers for display only; store and calculate with raw numbers. Percent style multiplies by 100, so pass 0.25 to show 25%.

Everything is calculated in your browser.

How do I add thousands separators in JavaScript?

Use n.toLocaleString() or new Intl.NumberFormat("en-US").format(n). Both add the separators for the given locale.

Why does my currency show a code instead of a symbol?

Some locale and currency combinations use the ISO code to avoid ambiguity, such as US$ or CA$. Pass currencyDisplay: "narrowSymbol" to prefer a bare symbol like $.

Why are file sizes shown in KB of 1,000 bytes?

That is the SI convention used by macOS, phones and storage makers. Windows uses 1,024-byte units, properly called KiB and MiB.

Made by BufferMint. We also design and build software products for founders. See our services →

Your files and inputs never leave your device; we only count anonymous visits.