About the Extract Numbers from Text tool
Copying prices from an email, figures from a report or readings from a log file one at a time is slow and easy to get wrong. This tool will extract numbers from text in one step, recognising decimals, negative values and comma thousands separators, and it lists them one per line or comma separated, with the count, sum, average, minimum and maximum.
A number is a run of digits, optionally with comma-separated groups of three (1,234,567) and a decimal part (12.50). A minus sign is read as negative only when it starts the number, so a range such as 10-20 gives 10 and 20, not 10 and −20. Thousands separators are removed in the output so the values paste straight into a spreadsheet or calculator, while the original decimal places are kept, so 12.50 stays 12.50. Numbers inside words, such as the 3 in MP3, are included, which you can turn off.
Example: "Order 3 items at $12.50 each, total 1,234.5 and -7 degrees; range 10-20." gives 3, 12.50, 1234.5, -7, 10 and 20: six numbers that add up to 1,273, with an average of 212.17.
To sum or average a list you already have, the average calculator and standard deviation calculator take numbers directly. For spread and outliers use the quartile calculator, and for email addresses the email extractor.
How to use the Extract Numbers from Text tool
- Paste the textAny text, table or log that contains numbers.
- Choose the optionsWhole numbers only, ignore minus signs, or skip digits inside words.
- Choose the separatorNew lines, commas or spaces.
- Read the totalsCount, sum, average, minimum and maximum.
Extract Numbers from Text features
- Integers, decimals and negatives
- Thousands separators understood
- Ranges like 10-20 handled
- Count, sum, average, min and max
- Whole numbers only option
- Skip digits inside words
- Spreadsheet-ready output
Common uses
- Totaling prices from an email or invoice text
- Pulling figures out of reports
- Cleaning data copied from PDFs
- Reading values from log files
- Checking numbers in homework
Pulling numbers out of text: formats, pitfalls and quick statistics
Copying figures out of an email, a report or a chat export by hand is slow, and it is easy to skip a value or type 1,520 as 1,250. Extracting numbers automatically is faster and more reliable, but only if you understand what the extractor treats as a number. This guide covers the number formats used around the world, the kinds of digits that are not really quantities, and how to read the count, sum, average, minimum and maximum once the numbers are out.
Where numbers hide
Numbers turn up in places that were never meant for calculation: prices quoted in a string of WhatsApp messages, measurements typed into site notes, scores pasted from a results page, figures in the middle of a long report or values scattered through a server log. Survey answers often contain numbers mixed with words, such as "about 3 hours a day" or "between 20 and 30".
In every case the goal is the same: get the values into a clean list that you can add up, compare or paste into a spreadsheet, without retyping them. Extraction also gives you a quick sense check, because the count tells you whether every value you expected was found.
Number formats around the world
The same quantity is written differently depending on the country and the software that produced it.
| Format | Where it is common | Meaning |
|---|---|---|
| 1,234.56 | UK, US, Pakistan, India for decimals | one thousand two hundred thirty-four point five six |
| 1.234,56 | Germany, Spain, Italy, much of Latin America | the same value, with the roles of comma and point swapped |
| 1 234,56 | France, Russia, Scandinavia | a space groups the thousands |
| 1'234.56 | Switzerland | an apostrophe groups the thousands |
| 12,34,567 | India, Pakistan | lakh grouping: twelve lakh, thirty-four thousand, five hundred sixty-seven |
An extractor that expects the first style reads "1.234,56" as two separate numbers or as 1.234 with something left over. If your text comes from a source that uses decimal commas, convert it first: remove the thousands points, then change the decimal comma to a point. Do this with care, because a value such as "1.500" means one and a half in English text but one thousand five hundred in German text.
Digits that are not quantities
Many runs of digits in text are labels rather than amounts. Dates such as 24/10/2026 give 24, 10 and 2026; times like 14:30 give 14 and 30; phone numbers, postcodes, order IDs, version numbers such as 2.4.1 and ordinals such as 1st and 22nd all produce numbers that mean nothing when added together.
Before summing, think about what the text contains. Removing lines that hold dates and reference numbers, or using the option to skip digits inside words, keeps codes like "A320" or "room12" out of the results. When the text mixes both kinds of value, it is often quickest to extract everything and then delete the obvious labels from the list before calculating.
Negative numbers, ranges and brackets
A minus sign directly before a number marks it as negative, while a hyphen between two numbers, as in 10-20, normally means a range. Text copied from documents may use the true minus sign (−) or an en dash (–) instead of the keyboard hyphen, and these behave differently in different tools, so check negative values after extraction.
Accounting documents often show negative amounts in brackets, such as (1,250) for a loss or a refund. A general extractor reads that as a positive 1,250, which turns a deduction into an addition. If your source uses brackets for negatives, replace them with a leading minus sign first, for example with Find and Replace Text.
Percentages and scientific notation
Percentages come out as plain numbers, so "15%" becomes 15. That is fine for listing them, but be careful when averaging: the average of several percentages is only meaningful when each one is based on the same total. If one class of 10 pupils had a 90% pass rate and another of 40 pupils had 50%, the overall pass rate is 58%, not the simple average of 70%. For that kind of calculation, Weighted Average Calculator gives the right answer.
Scientific notation such as 1.5e3 (meaning 1,500) is common in data exports and scientific text. A general extractor may split it into 1.5 and 3, so convert such values in a spreadsheet or check them by hand.
Reading the summary statistics
The count, sum, average, minimum and maximum each tell you something different. The count confirms that every value was found. The sum gives totals such as spending or hours. The minimum and maximum are excellent error detectors: a maximum of 25,000 in a list of prices that should be around 2,500 usually means an extra zero or a missing decimal point somewhere.
The average is useful but sensitive to extreme values. In a list of house prices or salaries, a single very large value pulls the average upward, so the middle value, the median, often describes a typical case better. For spread and outliers, paste the list into Quartile Calculator or Standard Deviation Calculator.
A worked example: a month of expenses
Suppose your expense notes for a month read: "Groceries 2,350. Fuel 4,000. Mobile top-up 1,200. Lunch with Sara 850. Refund -500. Books 1,640." Extraction finds six numbers: 2350, 4000, 1200, 850, -500 and 1640. The sum is 9,540, the average is 1,590, the minimum is -500 and the maximum is 4,000.
The negative refund correctly reduces the total. If the refund had been written as "(500)" instead, the extractor would have added 500 rather than subtracting it, giving 10,540, which shows why a quick look at the minimum is worthwhile. A count of six also matches the six entries in the notes, so nothing was missed.
Rounding and decimal precision
Computers store most decimal values in binary, which cannot represent some numbers exactly. The well-known result is that 0.1 plus 0.2 gives 0.30000000000000004 inside many programs. Good tools round the displayed result, but when you work with money it is best to keep full values during the calculation and round to two decimal places only at the end. Rounding every value first and then adding can make a total differ by a few paisa or cents from the true figure.
Moving the numbers into a spreadsheet
A list with one number per line pastes straight into a single spreadsheet column, while a comma-separated list suits a single row or another program. Once the values are in a column, functions such as SUM, AVERAGE, MEDIAN, MIN and MAX reproduce the summary and update if you edit a value. If the spreadsheet treats the pasted values as text, which shows as numbers aligned to the left, change the cell format to Number or use the program's text-to-columns feature.
Custom patterns with regular expressions
For special cases, such as extracting only prices that follow a currency sign or only numbers with exactly six digits, a regular expression gives precise control. A pattern such as -?\d+(?:,\d{3})*(?:\.\d+)? matches optional minus signs, thousands groups and decimals. You can build and test patterns safely in Regex Tester before using them in a spreadsheet or a script.
Common mistakes
- Summing dates, phone numbers or reference codes along with real amounts.
- Mixing decimal-comma text with decimal-point text in one extraction.
- Losing negative values written in brackets or with a special minus sign.
- Averaging percentages that are based on different totals.
- Rounding each value before adding them up.
Related tools
To add up or average a list you have already cleaned, use Average Calculator. To turn a total into words for a cheque or an invoice, try Number to Words Converter, and to pull email addresses out of the same text, use Email Extractor.
Privacy
Numbers are extracted in your browser. Bank statements, invoices and other text you paste are not uploaded or stored.
Frequently asked questions
How do I extract numbers from text?
Paste the text and every number is listed straight away, with the count and sum shown above. Copy the list one per line to paste into a spreadsheet column.
Does it handle decimals and negative numbers?
Yes. 12.50 and -7 are read correctly, and the decimal places are kept as written. A minus sign counts only when it comes right before the number, not inside a range like 10-20.
What about numbers with commas like 1,234?
Commas between groups of three digits are treated as thousands separators, so 1,234,567 becomes 1234567. A comma followed by a space, as in a list, separates numbers instead.
Can I extract only whole numbers?
Yes. Turn on whole numbers only and decimals are skipped. Use it for counts, IDs and years, for example. Negative whole numbers are still included unless you also ignore minus signs.
How do I sum numbers in a paragraph?
Paste the paragraph and read the sum in the results. The average, minimum and maximum are shown too, so you do not need a spreadsheet for a quick check.
Are numbers inside words included?
By default yes, such as the 4 in COVID-19's 19 or the 3 in MP3. Turn on skip numbers inside words to ignore digits that are attached to letters.
Does it read European decimal commas?
No. The tool expects a point for decimals and commas for thousands, the English convention. For text with 12,5 meaning twelve and a half, replace the commas first.
How do I extract numbers in Excel?
Microsoft 365 users can use TEXTSPLIT or REGEXEXTRACT in newer builds; older versions need long formulas or VBA. Pasting the text here is usually faster.
Can I extract phone numbers?
Phone numbers are split into their digit groups, because spaces and dashes separate them. For whole phone numbers, a dedicated pattern is needed, as their formats vary from country to country.