Favorites

JavaScript Number.prototype.toLocaleString() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Number.prototype.toLocaleString()
JavaScript Number Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The toLocaleString() method formats a number for a given language and region, with the right digit grouping, decimal separator and optional currency.

Description

The toLocaleString() method returns a language-sensitive representation of the number, using Intl.NumberFormat behind the scenes. Without arguments it uses the user's language, so the same number may show as "1,234.5" or "1.234,5". Options let you format currency, percentages and units, and control decimal places.

Each call creates a new formatter behind the scenes, so when formatting many numbers with the same settings, create one Intl.NumberFormat and reuse its format() method, which is noticeably faster. The output is meant for people, so don't parse it back into a number or store it.

Options include minimumFractionDigits and maximumFractionDigits to control decimals, notation: 'compact' for short forms such as "1.2K", and style: 'unit' with a unit like 'kilobyte' for measurements. BigInts and dates have their own toLocaleString() methods.

Syntax

number.toLocaleString()
number.toLocaleString(locales, options)

Parameters

  • localesOptional. A language tag such as "en-AU".
  • optionsOptional. The same options as Intl.NumberFormat, such as style and currency.

Return Value

A string with the number formatted for the language.

Example

const n = 1234567.891;
console.log(n.toLocaleString('en-US'));
console.log(n.toLocaleString('de-DE'));
console.log((19.5).toLocaleString('en-AU', { style: 'currency', currency: 'AUD' }));
console.log((0.75).toLocaleString('en', { style: 'percent' }));

Browser Support

The following information will show you the current browser support for the Number.prototype.toLocaleString() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee