Number formatter — thousands separators and decimals for 17 locales

Enter a number and see it formatted the way 17 locales write it, from Indian lakh grouping to Swiss apostrophes, as a plain number, currency, percent, compact, scientific or engineering value, with the matching JavaScript Intl code.

Live demo · real result from this tool
Formatted12,34,567.89
Locale
en-IN

Same number in other locales

LocaleFormatted
English (US) (en-US)1,234,567.89
English (UK) (en-GB)1,234,567.89
English (India) (en-IN)12,34,567.89
Hindi (hi-IN)12,34,567.89
German (de-DE)1.234.567,89
French (fr-FR)1 234 567,89
Spanish (es-ES)1.234.567,89
Italian (it-IT)1.234.567,89
Portuguese (Brazil) (pt-BR)1.234.567,89
Dutch (nl-NL)1.234.567,89
Swedish (sv-SE)1 234 567,89
German (Switzerland) (de-CH)1'234'567.89
Russian (ru-RU)1 234 567,89
Japanese (ja-JP)1,234,567.89
Chinese (zh-CN)1,234,567.89
Korean (ko-KR)1,234,567.89
Arabic (Egypt) (ar-EG)١٬٢٣٤٬٥٦٧٫٨٩

17 rows — scroll inside the table, or download the CSV.

JavaScript

new Intl.NumberFormat("en-IN", {"useGrouping":true,"minimumFractionDigits":2,"maximumFractionDigits":2}).format(1234567.891)

Processed on your device — nothing is uploaded.

How to use the number formatter

  1. Enter the Number, for example 1234567.891. Spaces, underscores and apostrophes are stripped as grouping marks. A comma is grouping (1,234,567.89) unless it is the last separator and not plain three-digit grouping (1 234 567,89, 1.234.567,89); then it is read as the decimal mark and a note says so.
  2. Choose the Locale, for example English (India) (en-IN) or German (de-DE).
  3. Pick a Style: Number, Currency, Percent (×100), Compact (1.2M), Scientific or Engineering. For Currency, choose one of 12 Currency codes.
  4. Set Decimal places (0–20) and tick or untick Thousands separators.
  5. Read Formatted, compare it with the other 16 locales in the table, and copy the JavaScript line if you want the same result in code.

What it does and when to use it

Hard-coding commas and dots breaks as soon as an app is used in another country. This tool shows what Intl.NumberFormat will produce before you ship. Use it to check an invoice layout, a dashboard in several markets, or a test that compares formatted strings.

For file sizes use the bytes humanizer. To turn written numbers such as “two thousand” into digits, use words to number. For durations, use the duration humanizer.

How it works

The cleaned input is converted with Number(). Anything that is not a finite number gives an error like "abc" is not a number. The tool then builds an options object and calls new Intl.NumberFormat(locale, options).format(n) in your browser:

  • Number, Currency and Percent use minimumFractionDigits and maximumFractionDigits equal to your decimal places, plus useGrouping.
  • Compact uses notation: "compact" with at most 2 decimals. It ignores the separators checkbox.
  • Scientific and Engineering set notation and a maximum number of decimals.

The JavaScript line repeats those exact options.

Worked examples

1234567.891 with 2 decimal places, Number style:

English (US) (en-US) | 1,234,567.89
English (India) (en-IN) | 12,34,567.89
German (de-DE) | 1.234.567,89
German (Switzerland) (de-CH) | 1'234'567.89

The JavaScript line for en-IN:

new Intl.NumberFormat("en-IN", {"useGrouping":true,"minimumFractionDigits":2,"maximumFractionDigits":2}).format(1234567.891)

Compact style turns the same number into 1.23M in en-US, 12.35L in en-IN and 1,23 Mio. in de-DE.

European input: 1 234 567,89 gives Formatted: 1,234,567.89 in en-US, with the note The comma in "1 234 567,89" was read as the decimal mark, so the number is 1234567.89.

Limits and tips

  • Precision. Values above 9,007,199,254,740,991 in size are rejected, and long decimals are limited by double-precision floating point. Do money arithmetic in integer minor units, and format only at the end.
  • Hidden spaces. French, Swedish and Russian group with no-break spaces, which can make string comparisons in tests fail.

Frequently asked questions

Can I type 1 234 567,89 with a decimal comma?
Yes. When a comma is the last separator and is not plain three-digit grouping, it is read as the decimal mark and a note says so. A lone 1,234 is still read as one thousand two hundred and thirty-four, so use a dot as the decimal point when in doubt.
How does Indian grouping differ?
After the first three digits from the right, en-IN and hi-IN group in pairs, so one million is 10,00,000 (ten lakh) and 1234567.891 is 12,34,567.89. In Compact style the same number becomes 12.35L.
Why does yen show two decimal places?
Decimal places is applied to every style, including currency. The yen is normally written without decimals, so set Decimal places to 0 for JPY, and check the usual minor unit for any currency you format.
Will my users see exactly this output?
Usually, but not always. The formatting comes from the locale data built into each browser or Node version, and details such as the Swiss group separator or spacing in French can change between versions. Treat the output as a preview, and format at runtime with Intl in your own code.
Does Percent multiply by 100?
Yes. 0.0725 with 1 decimal place is 7.3% in en-US and 7,3 % in fr-FR, with a no-break space before the sign. Enter the fraction, not the percentage.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close