Number Formatter (Intl.NumberFormat)
Format a number the way each locale expects — 1,234,567.89, 1.234.567,89, $1.23M, 12 345 ₽ — and grab the matching JavaScript snippet.
Formatted
1,234,567.891
new Intl.NumberFormat('en-US', {
"style": "decimal",
"notation": "standard",
"useGrouping": true,
"minimumFractionDigits": 0,
"maximumFractionDigits": 3
}).format(1234567.891)All formatting uses your browser's built-in Intl.NumberFormat — same engine your production code will use.
How to use
- Type a number and pick a locale.
- Choose a style (decimal/currency/percent/unit) and adjust precision.
- Try compact notation for
1.2Mstyle summaries, scientific for1.234E6. - Copy the formatted result or the matching JavaScript snippet.
About this tool
ShowHide
A visual front-end for Intl.NumberFormat. Pick a locale (en-US, de-DE, ja-JP, …), a style (decimal, currency, percent, unit), a notation (standard, scientific, engineering, compact), and digit precision. The tool shows the formatted output and the exact JavaScript call that produced it, so you can paste it into your codebase. Helpful for previewing how prices, counts, percentages, or unit values will render in different markets.
The separators swapping is the change people notice first and the one that breaks parsing quietly. German writes 1.234,56 where English writes 1,234.56, so a number formatted for one locale and read back by code expecting the other is off by three orders of magnitude or fails outright. Formatting is one-way: Intl has no parser, and recovering a number from a localised string means stripping the separators for that locale yourself.
Grouping is not always in threes. Indian locales group the lowest three digits and then in pairs, so ten million reads as 1,00,00,000, and several locales group only above a threshold or not at all. Any layout that reserved space by counting commas has assumed something the standard does not promise.
Currency formatting carries the position, the symbol and the digit count, all of which vary. The euro follows the amount in German and precedes it in Irish English, the yen has no minor unit so it formats with zero decimals, and the dinar has three. Hard-coding two decimal places is the assumption that breaks at both ends of that list.
Compact notation is locale-specific text rather than an abbreviation you can localise later. English gives 1.2M, German 1,2 Mio., Japanese 120万 on a different grouping entirely, because the language counts in ten-thousands. A design that budgeted four characters for a compact number is sized for English alone.
The browser supplies the data, so output can differ slightly between engines and versions as CLDR is updated. Pin what matters to a test rather than to a screenshot.
Frequently asked questions
Why does German format 1.234,56 with a comma decimal?
Locale convention. German (de-DE) uses . as thousands separator and , as decimal — the opposite of US English. Intl.NumberFormat knows this for every locale, which is why hardcoding toFixed() and your own commas is fragile for international apps.
What's compact notation for?
Short labels — 1.2K, 3.4M, 5億 in Japanese. Use it for dashboards or chart axes where space matters and exact digits don't. Pair with maximumFractionDigits: 1 for typical UI sizing.
Why does percent show 100x what I typed?
Percent style multiplies by 100. To format 0.42 as 42%, that's the expected behavior; if you've already pre-multiplied to 42 and want 42%, append a literal % instead of using percent style.
Which currencies and units are supported?
All ISO 4217 currency codes for currency style. For units, browsers support a defined sanctioned subset (meter, kilometer, mile, byte/megabyte, etc.) — this tool exposes the common ones. See MDN's Intl.NumberFormat options for the full list.
Guides on this topic
Related tools
URL Encoder / Decoder
Percent-encode text for URLs, or decode encoded URLs back to text.
Developer
Bloom Filter Calculator: Size, Hashes & Error Rate
Size a Bloom filter for n items at a target false-positive rate, or get a filter's error rate or capacity, with the best number of hash functions.
Developer
Credit Card Validator (Luhn + Brand)
Validate a card number with the Luhn checksum, detect brand (Visa/MC/Amex/etc), and check expected length. Local, no network.
Developer
ISBN Validator (ISBN-10 / ISBN-13)
Validate ISBN-10 and ISBN-13 checksums and convert between the two formats. Hyphens and spaces are handled.
Developer
Python .pyc Bytecode Inspector
Open a .pyc from __pycache__ in your browser: which CPython wrote it, timestamp or hash invalidation, the code object tree and the disassembly.
Developer
CRL Decoder (X.509)
Read a certificate revocation list in your browser: issuer, CRL number, validity window, every revoked serial with its reason, and the signature.
Developer