Skip to content
ZeroServer.tools

Extract Numbers

Pull every number out of a block of text.

Numbers Found: 0Characters: 0

Extracting numbers from text

This tool scans any text and pulls out numeric values — integers, decimals, negatives, and comma-grouped figures like 1,299.99. Strip the thousands separators to get clean values you can paste into a spreadsheet, deduplicate them, or sort them numerically. Useful for scraping prices, IDs, or measurements out of logs and documents. All processing happens locally in your browser.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Pulling figures out of a report to total them.
  • Extracting quantities from a pasted list.
  • Getting version numbers out of a changelog.
  • Collecting measurements from prose for a calculation.
  • Auditing text for numeric identifiers that should have been redacted.

Frequently Asked Questions

Are decimals and negatives recognised?
They should be, and a bare \d+ pattern catches neither — it splits 3.14 into 3 and 14 and drops the minus from -5. A correct pattern handles an optional sign, a decimal point, and scientific notation like 1.2e-3.
How are thousands separators handled?
This is genuinely ambiguous across locales. 1,234 is one thousand in English and 1.234 is one thousand in German — the same characters mean opposite things. Extraction cannot resolve this without knowing the locale.
Are numbers inside words extracted?
By default yes: 'COVID-19' yields 19 and 'h2o' yields 2. If you want standalone values only, the pattern needs word boundaries — otherwise version strings and product codes flood the results.
What about non-Latin digits?
An ASCII [0-9] pattern misses Arabic-Indic (٣٫١٤), Devanagari and fullwidth digits entirely. Unicode-aware extraction uses \p{Nd}, though converting those to a numeric value still needs per-script handling.
Are dates and times extracted as numbers?
They fragment — 2024-03-15 becomes 2024, 3 and 15, and 12:30 becomes 12 and 30. If dates matter, match them with a date pattern before extracting numbers, or the results are meaningless.
Are numbers in scientific notation recognised?
Only if the pattern includes the exponent — otherwise `1.5e3` yields `1.5` and a stray `3`, silently changing the value by a factor of a thousand. It is the most damaging failure mode in numeric extraction.
How should extracted values be summed?
Carefully, because the source may mix units and scales. A column of "1.2M" and "850K" extracts as 1.2 and 850, which sums to something meaningless — the magnitude suffix has to be handled before arithmetic.
What about numbers written as words?
They are not extracted — "twenty-three" contains no digits. Converting spelled-out numbers is a separate problem with its own ambiguities, which is why it belongs in a dedicated word-to-number tool.

Common errors and gotchas

  • Splitting a decimal at the separator, which turns 3.5 into two numbers.
  • Capturing a version like 1.2.3 as three separate values.
  • Losing the sign on a negative number, which reverses its meaning.
  • Missing numbers written as words, which no numeric pattern will find.
  • Extracting digits from inside identifiers, which are not quantities at all.

Related Text Tools tools

Private & free — this tool runs entirely in your browser.