π’ Add Commas to Numbers (Free Thousands Separator Tool)
By ToolNimba Editorial Team Β· Updated 2026-06-21
Enter numbers above to format them.
This number formatter adds commas (or any thousands separator you prefer) to make big numbers easy to read at a glance. Paste a single value or a whole list, one number per line, and choose your grouping style, decimal places and decimal mark. There is also a strip mode that does the reverse, removing existing separators so a number is ready to paste into a spreadsheet, calculator or code. Everything runs in your browser, so your numbers never leave the page.
What is the Number Formatter?
A thousands separator is a small mark placed every three digits to break a long number into readable groups. The number 1234567 is hard to read, but written as 1,234,567 your eye instantly sees roughly one and a quarter million. The grouping always starts from the right of the whole-number part and works left in groups of three, so the leftmost group can have one, two or three digits. The fractional part after the decimal mark is never grouped this way. This tool automates the whole job for one number or a long list, so you do not have to count digits and place commas by hand.
Different regions use different marks, which is the main source of confusion. The United States, the United Kingdom and most English-speaking countries use a comma for thousands and a point for the decimal, so 'one thousand two hundred and thirty four, and a half' is written 1,234.5. Much of continental Europe swaps them, writing 1.234,5 with a period for thousands and a comma for the decimal. Others, including the SI metric standard and countries like France and Sweden, use a thin space (1 234,5), and Switzerland traditionally uses an apostrophe (1'234.5). This tool lets you pick the grouping character and the decimal mark independently so you can match any of these conventions.
Writing style guides also have rules about when to use a comma at all. The Associated Press Stylebook and the Chicago Manual of Style add a comma to any whole number of four or more digits, so 1,270 and 5,255 take a comma. The important exceptions are years (2026, not 2,026), page numbers (page 1535), street addresses (5255 Ocean View Drive), and most identifiers like phone numbers, serial numbers and zip codes. Scientific and engineering writing often drops the comma in four-digit numbers and uses a thin space instead of a comma in larger ones. When you paste a list into this tool you stay in control of the grouping, so you can follow whichever house style applies.
The formatting is purely cosmetic: it changes how a number looks, not its value. That matters when you move numbers between tools. A spreadsheet, programming language or database usually wants a plain number with no grouping (and a point as the decimal), so a value displayed as 1,234.50 must be stripped back to 1234.50 before it will parse. The strip mode here does exactly that, removing commas, spaces, periods and apostrophes used as group marks while preserving the decimal portion exactly as entered, so you can round-trip numbers between human-friendly and machine-friendly forms.
Under the hood, every spreadsheet and programming language does this with a built-in formatter rather than manual string surgery. Excel and Google Sheets apply a number format like #,##0 (or the TEXT function, =TEXT(A1,"#,##0.00")) so the cell keeps its true numeric value while displaying commas. JavaScript uses (1234567).toLocaleString() or the Intl.NumberFormat API, and Python uses the format mini-language, f"{1234567:,}", to get 1,234,567. This tool gives you the same result without writing any code, which is handy when you just need formatted text to drop into a document, email, caption or slide.
Why bother at all? Readability and accuracy. Unseparated numbers like 100000000 invite misreading by an order of magnitude, and a single misplaced zero in a financial figure or a report can be costly. Grouping digits into threes lets a reader sound out the scale (thousand, million, billion) at a glance, reduces transcription errors, and makes tables of figures line up cleanly. That is why almost every newspaper, annual report, invoice and dashboard formats large numbers, and why doing it consistently across a document looks professional.
When to use it
- Formatting figures in a report, invoice or slide so large amounts like 1,250,000 are instantly readable.
- Cleaning a column of numbers that already contain commas so they can be pasted into a spreadsheet or imported as plain values.
- Switching a list between US style (1,234.56) and European style (1.234,56) for an international document.
- Standardising prices, populations or statistics to a fixed number of decimal places before publishing.
- Preparing numbers for code, JSON or a CSV where grouping characters would break parsing.
- Adding commas to a long list of values at once instead of formatting each number by hand in a document.
How to use the Number Formatter
- Enter your numbers in the box, either a single value or one number per line.
- Pick Add separators to format, or Strip separators to remove them.
- Choose the thousands separator (comma, space, period or apostrophe) and the decimal mark.
- Optionally set a fixed number of decimal places, the tool rounds for you.
- Read the formatted list in the result box and use Copy to grab all of it.
Formula & method
Worked examples
Format 1234567 with comma grouping and a point decimal mark.
- There is no decimal part, so all seven digits are whole-number digits.
- Group from the right in threes: 567, then 234, then 1.
- Join the groups with commas: 1 , 234 , 567.
Result: 1,234,567
Format 9876.5 to 2 decimal places, US style.
- Split into whole part 9876 and fraction 5.
- Round the fraction to 2 places: 5 becomes 50, giving 9876.50.
- Group the whole part in threes: 9 , 876.
- Add the decimal mark and the two fraction digits: 9,876.50.
Result: 9,876.50
Strip the separators from 1.234.567,89 (European style) for a spreadsheet.
- The last mark followed by digits is the comma before 89, so that is the decimal mark.
- Remove every grouping period from the whole part: 1234567.
- Keep the fraction and use a plain point: 1234567.89.
Result: 1234567.89
Format a four-digit number 5255 following AP and Chicago style.
- AP and Chicago add a comma to whole numbers of four or more digits.
- There is one group of three on the right (255) and one digit left over (5).
- Insert a comma between them: 5,255.
- Note: leave it as 5255 if it is a year, page number, address or zip code.
Result: 5,255
How the same value is written in different regional conventions
| Convention | Thousands mark | Decimal mark | Example (1234567.89) |
|---|---|---|---|
| US / UK | Comma | Point | 1,234,567.89 |
| Many EU countries | Period | Comma | 1.234.567,89 |
| SI / metric | Thin space | Comma or point | 1 234 567,89 |
| Switzerland | Apostrophe | Point | 1'234'567.89 |
| Plain (for code) | None | Point | 1234567.89 |
Grouping examples by number size (comma style)
| Plain number | Formatted | Word value |
|---|---|---|
| 1000 | 1,000 | One thousand |
| 25000 | 25,000 | Twenty-five thousand |
| 100000 | 100,000 | One hundred thousand |
| 1000000 | 1,000,000 | One million |
| 1234567890 | 1,234,567,890 | About 1.23 billion |
Add commas in common tools (1234567 to 1,234,567)
| Tool | Method | Example |
|---|---|---|
| Excel | Format Cells, tick Use 1000 Separator, or TEXT | =TEXT(A1,"#,##0") |
| Google Sheets | Format > Number, or TEXT function | =TEXT(A1,"#,##0") |
| Python | Format spec with a comma | f"{1234567:,}" |
| JavaScript | toLocaleString or Intl.NumberFormat | (1234567).toLocaleString() |
| Word / docs | Paste the formatted text from this tool | 1,234,567 |
Common mistakes to avoid
- Mixing up the thousands and decimal marks. In the US a comma groups thousands and a point is the decimal, but in much of Europe it is the opposite. Reading 1.234 as one and a bit when it means one thousand two hundred and thirty four (or the reverse) causes real errors. Always confirm which convention a number uses before formatting or stripping it.
- Leaving commas in numbers meant for a spreadsheet or code. A value like 1,234.50 is text to most software because of the comma. Pasting it into a spreadsheet cell or a program can break the math or import it as a string. Use strip mode to get the plain 1234.5 first.
- Grouping the digits after the decimal point. Thousands separators apply only to the whole-number part. The fractional digits are never split into groups of three, so 0.123456 stays as 0.123456, not 0.123,456.
- Adding commas to years, addresses or identifiers. Style guides exclude years (2026, not 2,026), page numbers, street addresses, zip codes, phone numbers and serial numbers from comma grouping. Commas are for quantities, not labels, so do not format an ID just because it is long.
- Assuming formatting changes the value. Adding separators is purely visual. 1,000 and 1000 are the same quantity. The only step that can change the value here is choosing fixed decimal places, which rounds the number.
- Hard-coding commas into a spreadsheet cell. Typing 1,234 directly into a cell can turn it into text or split it across columns on import. In Excel and Sheets, keep the real number and apply a number format (or TEXT) instead, so the value still calculates.
Glossary
- Thousands separator
- A mark (comma, space, period or apostrophe) placed every three digits in the whole-number part to make a long number easier to read.
- Decimal mark
- The symbol that separates the whole part of a number from its fractional part, a point in US style and a comma in much of Europe.
- Digit grouping
- The practice of breaking the integer part of a number into blocks of three digits, counting from the right.
- Strip
- Removing all grouping separators from a number so it becomes a plain value ready for software or further calculation.
- Rounding
- Shortening a number to a chosen number of decimal places, adjusting the last kept digit up or down based on the digit that follows.
- Integer part
- The whole-number portion of a value to the left of the decimal mark, the only part that gets grouped into thousands.
- Fractional part
- The digits to the right of the decimal mark, which represent a value less than one and are never grouped.
- Locale
- A regional setting that determines which thousands and decimal marks software uses, such as en-US for 1,234.56 or de-DE for 1.234,56.
Frequently asked questions
How do I add commas to a number?
Paste your number into the box and keep the mode on Add separators with the comma option selected. The tool inserts a comma every three digits from the right of the whole-number part, so 1234567 becomes 1,234,567. You can format a whole list at once by entering one number per line.
How do I remove commas from numbers?
Switch the mode to Strip separators. The tool removes commas, spaces, periods and apostrophes that act as grouping marks while keeping the decimal part, turning 1,234.50 back into 1234.50 so it is ready for a spreadsheet or code.
Where does the first comma go in a number?
Count three digits from the right of the whole-number part and place the first comma to the left of them, then repeat every three digits. So 12345 becomes 12,345 and 1234567 becomes 1,234,567. The leftmost group can have one, two or three digits.
Do four-digit numbers get a comma?
For quantities, yes. The AP and Chicago style guides add a comma to any whole number of four or more digits, so 1,270 and 5,255 take a comma. Exceptions are years, page numbers, addresses and most identifiers, which stay unformatted. Some scientific writing also leaves four-digit numbers as 1234.
Why are years like 2026 written without a comma?
Years are treated as labels rather than counted quantities, so style guides write 2026, not 2,026. The same applies to page numbers, street addresses, zip codes and serial numbers. Commas only go in numbers that express an amount, and years with five or more digits (such as 10,000 BC) do take one.
Can I use a space or a period instead of a comma?
Yes. The thousands separator menu lets you choose a comma, a space, a period or an apostrophe, and you can set the decimal mark to a point or a comma independently. That covers US (1,234.56), European (1.234,56), metric (1 234,56) and Swiss (1β234.56) styles.
How do I add commas to numbers in Excel or Google Sheets?
Keep the real number in the cell and apply a number format rather than typing commas. In Excel, open Format Cells, choose Number and tick Use 1000 Separator. In Google Sheets, use Format then Number. Either tool also supports a formula like =TEXT(A1,"#,##0") to output the value with commas as text.
How do I format a number with commas in Python or JavaScript?
In Python use the format spec with a comma, for example f"{1234567:,}" returns 1,234,567. In JavaScript use (1234567).toLocaleString() or the Intl.NumberFormat API, such as new Intl.NumberFormat("en-US").format(1234567). Both keep the underlying number intact and only change the display string.
Does adding commas change the actual number?
No. Separators are purely cosmetic and the value is unchanged, so 1,000,000 equals 1000000. The only setting that alters the value is choosing a fixed number of decimal places, which rounds the number to that many places.
Can I round to a set number of decimal places?
Yes. Use the decimal places menu to fix the output to 0, 1, 2, 3, 4 or 6 places. The tool rounds correctly, including carrying over, so 9999.96 to one place becomes 10,000.0. Leave it on "Keep as entered" to preserve the original decimals.
Is my data sent anywhere?
No. All formatting happens locally in your browser using plain JavaScript. Nothing is uploaded, logged or sent over the network, so you can safely format sensitive figures like salaries or financial data.