Skip to content
cliplimeClipLime

Extract numbers from text

Paste any text and get every number in it, plus the sum, average and median.

Your text

0 characters, 0 lines

Extracting numbers

Looking for numbers. Extract something else

Result

Your text is searched in this tab. Nothing found is opened, checked or uploaded.

At a glance

What it does
Finds every number in a text and lists it, with the sum, average, median, smallest and largest worked out for you.
Formats
Whole numbers, decimals with a point or a comma (.5 counts), thousands separators, scientific notation such as 6.022e23, and a leading minus (the hyphen or the true minus sign) or plus sign.
Plain numbers and sorting
Optionally rewrites 1,234.50 as 1234.50 and 05 as 5 for a spreadsheet or script. Sort in order found, smallest first or largest first, numerically, so 9 comes before 10.
Dates and ranges
2024-05-12 gives 2024, 05 and 12, and 10-20 gives 10 and 20. A minus counts as a sign only at the start of a number.
Not included
Currency symbols and percent signs are not part of a number, and numbers written in words are not found.
Privacy
Your text stays in your browser.

How to do it

  1. 1

    Paste your text

    Paste a report, an invoice, a log or any text with figures in it. Load a file if you have one saved.

  2. 2

    See the numbers

    The Numbers list shows every number found. The summary under it gives the sum, average, median, smallest and largest.

  3. 3

    Tidy the list

    Turn on Plain numbers to remove thousands separators, and sort smallest or largest first. Turn off Remove duplicates to keep repeats.

  4. 4

    Copy the result

    Copy the numbers one per line, or separated by commas, or download them as numbers.txt.

What counts as a number

A number is a run of the digits 0 to 9. It may start with a minus or plus sign, include thousands separators, and end in a decimal part, so -1,234,567.89 is one number. Digits next to letters count: the 3 in 3kg and the 101 in Room101 are found. Only the digits 0 to 9 are read, so digits from other scripts, such as Arabic-Indic or full-width digits, are not found.

Scientific notation is one number when it stands on its own: 6.022e23 and 1.5E-3 are found whole and counted in the sum. Next to letters or other digits, an e is only a letter, so the code SKU12E4 gives 12 and 4. A decimal can start with the point, so .5 is 0.5, and a minus sign can be the true minus sign (U+2212) as well as the hyphen.

A minus sign is part of a number only when it is not directly after a letter or digit. That is why -5 is minus five, while the hyphen in 10-20 or 2024-05-12 is a separator, and gives the numbers 10 and 20, or 2024, 05 and 12. Plain numbers drops the leading zero of 05.

Currency symbols and percent signs are not part of the number: $19.99 gives 19.99 and 45% gives 45.

Thousands separators and decimal commas

Different countries write 1,234 and 1.234 differently, so the tool has a rule for the cases that could mean either. A comma followed by exactly three digits is read as a thousands separator, so 1,234 is 1234. A point is read as a decimal point, so 1.234 is 1.234. A comma followed by one, two or four or more digits is a decimal comma, so 3,5 is 3.5.

When a number has both, the last one is the decimal separator: 1.234.567,89 and 1,234,567.89 are both 1234567.89. Numbers with spaces as separators, such as 12 345, are read as two numbers, and Indian grouping such as 1,00,000 is not read as one.

The same rules apply to a list written with commas and no spaces, so check lists like that. 10,20,30 is read as 10,20 (a decimal comma) and 30, and 100,200,300 is one number, 100200300. Put a space after each comma, as in 10, 20, 30, to get separate numbers.

The summary

The sum, average, median, smallest and largest are worked out on every number found, in plain form and before duplicates are removed, so a figure that appears twice is counted twice. Rounding is limited to 12 significant digits, so adding 0.1 and 0.2 gives 0.3 and not 0.30000000000000004.

If a text mixes figures that mean different things, such as phone numbers, dates and prices, the summary adds them all together. Cut the text down to the part you mean, or use the list rather than the summary.

Questions people ask

How do I extract all the numbers from a text?

Paste the text into the box. The Numbers list shows each number found, and the summary gives their sum, average, median, smallest and largest. Copy the list or download it.

Why does a date give three numbers?

A date such as 2024-05-12 is three numbers joined by hyphens, so it is listed as 2024, 05 and 12. The tool reads numbers, not dates, so it does not combine them.

How are 1,234 and 1.234 read?

1,234 is read as one thousand two hundred thirty-four, because a comma followed by three digits is a thousands separator. 1.234 is read as one point two three four. When both appear in one number, the last one is the decimal separator.

Does it find negative numbers and prices?

Yes to negative numbers: a minus sign directly before the digits, with a space or nothing in front, makes the number negative. For prices, it finds the number but not the currency symbol, so $19.99 gives 19.99.

Can it find numbers written in words?

No, only digits. To turn digits into words, use the number to words converter.

Does the sum count duplicates?

Yes. The summary uses every number found, including repeats, so the sum matches adding up every number in your text. The list can show each different number once.

Guides that help

All Text guides →