AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I format a number as currency?

Type a number into AnyTool Currency Formatter and it formats it as money instantly — pick a currency (USD, EUR, GBP, JPY, INR and 50+ more) and, separately, a locale that controls the grouping and where the symbol sits. So 1234567.89 becomes $1,234,567.89 in en-US, 1.234.567,89 € in German and ₹12,34,567.89 in en-IN. You can switch the symbol to a code or name, use accounting parentheses for negatives, turn on compact notation (1.2M) and set the decimal places — and copy the exact Intl.NumberFormat code. Note it formats; it does not convert exchange rates. Everything runs in your browser.

  • Formats any number as currency with the locale’s real conventions
  • 50+ currencies and 22 locales, chosen independently
  • Accounting negatives ($1,234), compact 1.2M, custom decimals, sign control
  • Copies a ready-to-paste Intl.NumberFormat snippet for developers
  • 100% in your browser — no upload, no signup, works offline

What is

Currency Formatting

Currency formatting turns a plain number into a money string with the correct symbol, thousands separator, decimal separator and number of fraction digits for a given currency and locale. The currency (an ISO 4217 code such as USD) chooses the symbol and default decimal places, while the locale (a BCP-47 tag such as de-DE) decides grouping and symbol placement. In the browser this is done with Intl.NumberFormat. It is distinct from currency conversion, which changes one currency’s value into another using exchange rates.

Converters

Related terms

Intl.NumberFormatISO 4217Thousands separatorAccounting formatLocale

Frequently Asked Questions

1234.5 formatted as US dollars is $1,234.50 — two decimal places with a comma thousands separator.

To format 1234.5 as US dollars you use the USD currency with the en-US locale, which gives $1,234.50: a leading dollar sign, a comma every three digits and two fraction digits. AnyTool does this live with Intl.NumberFormat and also shows you the exact code, so you can paste new Intl.NumberFormat(“en-US”, { style: “currency”, currency: “USD” }).format(1234.5) straight into your own project.

No. It formats a number as currency; it does not convert between currencies, because that would need live exchange rates from a server.

AnyTool Currency Formatter only formats — it chooses the symbol, separators and decimals for the currency and locale you pick. It does not convert, say, dollars into euros, because real conversion needs up-to-the-minute exchange rates fetched from a network service, which would break the promise that nothing leaves your browser. Every result here is computed locally with the built-in Intl.NumberFormat.

Turn on accounting format — then −1234 is shown as ($1,234.00) instead of with a minus sign.

Accounting style wraps negative amounts in parentheses, which is the convention in financial statements: −1234 becomes ($1,234.00). In Intl.NumberFormat this is the option currencySign set to “accounting”, and AnyTool exposes it as a single toggle that updates both the formatted result and the copyable code.

The locale, not the currency, controls grouping and symbol placement — so $1,234.56, 1.234,56 $ and ₹1,234.56 are the same USD amount written three ways.

A currency fixes the symbol and its default decimal places, but the locale decides how digits are grouped and where the symbol goes. The same USD amount is $1,234.56 in en-US, US$1,234.56 in some locales, and uses a different separator entirely in German (1.234,56). AnyTool lets you set currency and locale independently so you can reproduce exactly how each region writes the amount.

Detailed Explanation

Methodology

How the Currency Formatter Works

AnyTool Currency Formatter is a thin, safe wrapper over the browser-native Intl.NumberFormat. It parses the typed amount into a number (tolerating thousands separators), builds an options object with style set to currency plus the chosen currency code, and constructs a formatter for the selected locale inside a try/catch so an unsupported currency–locale pair degrades gracefully rather than throwing. The currency (an ISO 4217 code) determines the symbol and the default number of fraction digits, while the locale (a BCP-47 tag) determines digit grouping and where the symbol is placed — which is why the same amount renders as $1,234.56, 1.234,56 € or ₹1,234.56 depending on the locale, not the currency.

  • Built entirely on the standard Intl.NumberFormat API
  • Currency code sets the symbol and default fraction digits (ISO 4217)
  • Locale (BCP-47) sets grouping and symbol placement
  • Unsupported combinations are caught and reported, never thrown
  • All formatting is client-side JavaScript — no server round-trip
How It Works

Display, Notation and Digit Options

The formatter exposes the full set of Intl currency options. currencyDisplay switches between symbol, narrowSymbol, code and name. currencySign set to accounting wraps negatives in parentheses, e.g. ($1,234.00). notation set to compact produces short forms like $1.2M (or the long “$1.2 million”). useGrouping can drop the thousands separators, signDisplay controls when a + or − appears, and minimum/maximum fraction digits can be overridden or left at the currency’s ISO 4217 default. Crucially, the tool also renders the exact options object and a copy-paste new Intl.NumberFormat(locale, options).format(value) snippet, turning it into a live playground developers can lift straight into their own code.

  • currencyDisplay: symbol, narrowSymbol, code or name
  • currencySign accounting → negatives in parentheses
  • notation compact → $1.2M (short) or $1.2 million (long)
  • signDisplay, useGrouping and custom fraction digits
  • Emits the exact options object and an Intl.NumberFormat code snippet
Privacy & Security

Formatting Versus Conversion, and Privacy

The tool formats a number as currency; it deliberately does not convert one currency into another. Real conversion requires live exchange rates retrieved from a network service, which would contradict the product’s core promise that nothing leaves the browser — so that capability is intentionally out of scope and stated plainly in the interface. Because formatting relies only on the built-in Intl API, no amount is uploaded, there is no tracking, and the page works offline after first load.

Currency formatting: in-browser (AnyTool) vs typical online formatters
CapabilityAnyToolTypical online formatters
ProcessingRuns in your browserOften server-side
Currency × localeChosen independently, 50+ × 22Frequently locale-locked to the currency
Display modessymbol / narrowSymbol / code / nameUsually symbol only
Accounting & compactParentheses negatives and 1.2M notationRarely offered
Developer codeCopies the exact Intl.NumberFormat callAlmost never shown
Converts currenciesNo — formats only, stated honestlySometimes conflated with conversion
Works offlineYes (PWA)No
Cost / signupFree, no signupOften ad-heavy or gated

AnyTool formats locally with the standard Intl.NumberFormat and uploads nothing; it does not convert exchange rates.