number.toLocaleString(locales, options) returns a string of the number formatted for a language or region. It can add grouping separators, change the decimal mark, and show currency symbols.
Use it when you show prices or counts to people. Keep the raw number for math, and format only for display.
Syntax
Call toLocaleString on a number. Start with this line.
Pad decimals. Min/max fraction digits keep two places: "12.50".
Locale decimal mark. German uses a comma: "12,50".
Percent style. Multiplies by 100 and adds %.
vs toFixed.toFixed(2) is always plain "12.50" with a dot — no locale rules.
Compatibility
Browser & Runtime Support
Number.prototype.toLocaleString() is part of core JavaScript. Full Intl options are Baseline Widely available in modern engines.
✓ Baseline · Intl
Number.toLocaleString()
Safe in every modern browser and Node.js. Pass an explicit locale when output must match across machines.
99%Universal support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
toLocaleStringExcellent
Bottom line: Ideal for UI prices and counts. Keep raw numbers for math; format only when displaying.
Frequently Asked Questions
Number.prototype.toLocaleString() returns a string of the number formatted for a language or region. It can add thousand separators, change decimal marks, and format currency. Example: (123456.789).toLocaleString("en-US") is often "123,456.789".
locales is an optional BCP 47 language tag such as "en-US" or "de-DE" (or an array of tags). options is an optional object for style ("decimal", "currency", "percent"), currency codes, and digit counts. Omit both to use the runtime default locale.
Always a string. Use it for display. Convert again with Number() or parseFloat() only if you need more math — and be careful: locale strings may contain commas or currency symbols.
toFixed() always uses a plain decimal form with a fixed count of places. toString() prints a plain number string (optionally in another base). toLocaleString() follows locale rules for separators, symbols, and currency.
When you omit locales, the browser or Node.js uses its default locale. Pass an explicit locale such as "en-IN" when you need the same format everywhere.
Basic toLocaleString() is old and widely available. Full Intl options (currency, digit controls) are Baseline Widely available in modern browsers and Node.js.