JavaScript Intl.NumberFormat() Constructor

Beginner
5 min read
Updated: Nov 2026
3 examples
Constructor

Definition

new Intl.NumberFormat(locales, options) builds a formatter for numbers. Call format(value) to get a locale string with the right grouping and decimal marks.

Options can switch to style: "currency" or style: "percent" for money and percentages.

Remember
new Intl.NumberFormat(locales, options)
fmt.format(number)

style: "decimal" | "currency" | "percent"
currency: "USD" when style is currency

Syntax

Create a NumberFormat, then call format with a number.

JavaScript
const fmt = new Intl.NumberFormat("en-US");
console.log(fmt.format(1234567.89));
CallWhat it does
new Intl.NumberFormat("en-US")US English grouping and decimal point.
new Intl.NumberFormat("de-DE")German grouping and decimal comma.
{ style: "currency", currency: "USD" }Format a money amount.
{ style: "percent" }Format a ratio such as 0.25 as 25%.

A standard JavaScript constructor on the Intl object: create one with new Intl.NumberFormat(). No import required. Siblings: Intl.getCanonicalLocales(), Intl.supportedValuesOf(), Intl.Collator(), Intl.DateTimeFormat(), Intl.DisplayNames(), Intl.DurationFormat(), Intl.ListFormat(), Intl.Locale(), Intl.PluralRules(), Intl.RelativeTimeFormat(), Intl.Segmenter().

Library declarations
JavaScript
// ECMAScript 2015 — Intl.NumberFormat
new Intl.NumberFormat(locales, options)
fmt.format(value)

// options.style    : "decimal" | "currency" | "percent" | ...
// options.currency : ISO code when style is "currency"

Parameters

ParameterDescription
localesOptional. Locale string or list, such as "en-US" or "de-DE".
optionsOptional. Style, currency, fraction digits and more.
valueFor format: the number to format.

Return Value

Return ValueDescription
NumberFormat objectFrom the constructor.
stringFrom format: the localized number text.

JavaScript Examples

Example 1 — Same Number, Two Locales

Format 1234567.89 in American and German styles.

JavaScript
const n = 1234567.89;

console.log("en-US: " + new Intl.NumberFormat("en-US").format(n));
console.log("de-DE: " + new Intl.NumberFormat("de-DE").format(n));
Try It Yourself

How It Works

  1. Same value. Only the locale changes the separators.
  2. US style. Comma groups thousands; dot is the decimal mark.
  3. German style. Dot groups thousands; comma is the decimal mark.

Example 2 — Format a USD Amount

Use currency style with the USD code for a fixed price.

JavaScript
const fmt = new Intl.NumberFormat("en-US", {
  style: "currency",
  currency: "USD"
});

console.log(fmt.format(19.99));
Try It Yourself

How It Works

  1. style currency. Switches from plain decimal to money formatting.
  2. currency required. "USD" selects the dollar symbol and rounding rules.
  3. Locale still matters. The same USD amount can look different in other locales.

Example 3 — Format a Percent

Percent style multiplies by 100 and adds a percent sign.

JavaScript
const fmt = new Intl.NumberFormat("en-US", { style: "percent" });

console.log(fmt.format(0.25));
Try It Yourself

How It Works

  1. Ratios in. Pass 0.25 for twenty-five percent, not 25.
  2. Automatic scale. The formatter multiplies by 100 for display.
  3. Locale symbol. Spacing around % can differ by locale; en-US is compact here.

Browser & Runtime Support

Intl.NumberFormat is part of the original ES2015 Intl API (or arrived soon after and is now everywhere). Every current browser and Node.js has it.

✓ ES2015 · Widely supported

Intl.NumberFormat

Supported in Chrome 24+, Edge 12+, Firefox 29+, Safari 10+, Opera 15+ and Node.js 0.12+. Internet Explorer had partial Intl support only.

ES2015 Standard since
Google Chrome 24+ · Desktop & Mobile
Full support
Microsoft Edge 12+ · Chromium based
Full support
Mozilla Firefox 29+ · Desktop & Mobile
Full support
Apple Safari 10+ · macOS & iOS
Full support
Opera 15+ · Chromium based
Full support
Samsung Internet Recent versions · Android
Supported
Android WebView 24+ · Chromium based
Supported
Node.js 0.12+ · Server runtime
Supported
Deno Supported · JavaScript runtime
Supported
Bun Supported · JavaScript runtime
Supported
Internet Explorer No native support
Not supported
Intl.NumberFormat Excellent

Bottom line: Safe to use in every current browser and in Node.js. No feature-detect needed for modern code.

Frequently Asked Questions

It formats numbers into locale-aware strings, including plain decimals, currencies and percents.
They use different grouping and decimal separators. The numeric value is the same.
Use style: "currency" and set currency to an ISO code such as "USD".
It treats the number as a ratio. 0.25 becomes 25% in en-US.
Yes. Creating a formatter once and calling format many times is clearer and often faster.

Next: Intl.PluralRules

Learn how to choose one/other (and more) plural categories for a number.

Intl.PluralRules tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful