Number Formatter
Format numbers with international locales, currency presets, scientific notation, and custom styles.
Formatting Preset
Locale / Grouping
Formatted Output
1,234,567.89
Number formatting conventions around the world
Number formatting varies by locale: the US and UK write 1,234,567.89, while most of continental Europe writes 1.234.567,89 or 1 234 567,89 with a space.
This formatter integrates native browser Intl.NumberFormat capabilities to support local conventions, including the Indian lakh/crore grouping system (12,34,567.89) and the Chinese grouping system (123,4567.89), alongside Scientific and Engineering notations.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Formatting a number with thousand separators for display.
- Adding a currency prefix or a unit suffix consistently.
- Fixing decimal places so every figure in a report lines up.
- Producing a consistent format across a set of figures.
- Formatting a value for a locale that uses different separators.
Frequently Asked Questions
- Why do separators differ by country?
- Because there is no universal convention. 1,234.56 in the US and UK is 1.234,56 in Germany and 1 234,56 in France — the same characters mean opposite things, which is why locale-blind parsing of user input is unsafe.
- What is the correct way to format for a locale?
- Intl.NumberFormat, which knows the separators, grouping and currency conventions for each locale — including that Indian numbering groups as 12,34,567 (lakh and crore) rather than in threes.
- Which space is used as a separator in French?
- A narrow no-break space (U+202F), not an ordinary space. It is deliberate — it stops a number breaking across a line — but it means a naive trim or a plain-space regex fails to parse the value.
- How should currency be rounded?
- To the currency's own minor unit, which is not always two decimals: JPY has none, and KWD and BHD have three. Assuming two decimal places is a real bug in international billing.
- Should I store formatted numbers?
- No. Store the raw numeric value and format at display time. Storing '1,234.56' means every consumer must parse it, and the parse is locale-dependent — which is how numbers silently change by a factor of a thousand.
- Which rounding mode should financial code use?
- Not the default. Most languages round half away from zero or half to even, and neither matches every jurisdiction's rules for tax and interest. Anywhere the total must reconcile to the cent, the mode has to be chosen deliberately.
- Why should money not be stored as a floating-point number?
- Because binary floats cannot represent most decimal fractions exactly, so cents drift over repeated arithmetic. Store minor units as integers, or use a decimal type — the classic symptom is a total that is off by a penny.
Common errors and gotchas
- Using a comma as a thousand separator for a locale that uses it as the decimal mark.
- Formatting a value that will be parsed again, where the separators break it.
- Rounding for display and then using the displayed value in a further calculation.
- Formatting an identifier such as a reference number, which is not a quantity.
- Assuming one separator convention, which varies by country and by field.
Related Calculators tools
Percentage Calculator
Solve percentage, increase, and change calculations.
Age Calculator
Calculate exact age in years, months, and days.
Unix Timestamp Converter
Convert Unix epoch timestamps to and from human dates.
Tip Calculator
Calculate tip and split the bill between people.
Aspect Ratio Calculator
Solve width or height for a target aspect ratio.
Temperature Converter
Convert between Celsius, Fahrenheit, and Kelvin.
Data Storage Converter
Convert between bytes, KB, MB, GB, TB, and more.
Discount Calculator
Calculate sale price and savings from a discount.