Add Thousands Separators
Add thousands separators to numbers in text instantly. Supports commas, spaces, dots, and custom delimiters for easy number formatting.
About
Misreading 1000000 as 100000 is a one-zero mistake that has caused invoice errors, engineering miscalculations, and data-entry losses measured in real currency. The human visual system struggles to parse more than three or four consecutive digits without a grouping delimiter. This tool inserts thousands separators into every number found in your text, whether the input is a single value, a spreadsheet column, or a full paragraph containing mixed prose and figures. It detects integers, decimals, and negative values while leaving non-numeric content untouched.
Separator conventions vary by locale: the United States and United Kingdom use a comma (1,000,000), much of continental Europe uses a period (1.000.000), and ISOΒ 80000 recommends a thin space. The tool supports all three plus a custom character. Decimal portions are never separated. Numbers shorter than four digits are skipped by default. Note: the formatter assumes left-to-right digit grouping in groups of 3. It does not handle South Asian lakh/crore grouping (12,34,567). Already-formatted numbers are cleaned first to prevent double-separation.
Formulas
The formatter scans input text using a regular expression that matches numeric tokens including optional sign, integer digits, optional decimal tail, and optional scientific notation suffix. Each matched token is processed independently.
For each matched number string, existing separators are stripped to produce a clean digit sequence. The integer portion is then split from the decimal portion at the . character. Grouping is applied right-to-left in blocks of 3:
Where sep is the user-chosen thousands separator character, nint is the integer portion, and ndec is the decimal tail (unchanged). The regex \B(?=(\d{3})+(?!\d)) uses a positive lookahead to find every position in the integer string that is followed by a multiple-of-three digits before the end, inserting the separator at each such boundary.
Reference Data
| Locale / Standard | Thousands Separator | Decimal Separator | Example (1234567.89) |
|---|---|---|---|
| United States / UK | Comma , | Period . | 1,234,567.89 |
| Germany / France / Spain | Period . | Comma , | 1.234.567,89 |
| Switzerland (finance) | Apostrophe ' | Period . | 1'234'567.89 |
| ISOΒ 80000 (SI) | Thin space | Period or comma | 1β―234β―567.89 |
| India (lakh system) | Comma , | Period . | 12,34,567.89 |
| Japan / China / Korea | Comma , | Period . | 1,234,567.89 |
| Brazil / Portugal | Period . | Comma , | 1.234.567,89 |
| Sweden / Finland | Space | Comma , | 1 234 567,89 |
| Canada (English) | Comma , | Period . | 1,234,567.89 |
| Canada (French) | Space | Comma , | 1 234 567,89 |
| Russia / Ukraine | Space | Comma , | 1 234 567,89 |
| Turkey | Period . | Comma , | 1.234.567,89 |
| Mexico / Colombia | Comma , | Period . | 1,234,567.89 |
| Argentina | Period . | Comma , | 1.234.567,89 |
| South Africa | Space | Comma , | 1 234 567,89 |
| Australia / NZ | Comma , | Period . | 1,234,567.89 |
| Egypt / Arab States | Comma , | Period . | 1,234,567.89 |
| Poland / Czech Rep. | Space | Comma , | 1 234 567,89 |