Extract Numbers from Text

Paste any messy source, an invoice, a scraped product page, a chat log, a CSV with commentary, and get back a clean list of every number it contains. Integers, decimals, negatives and currency-style figures are recognized with a single regex pass. Output is deduplicated, one number per line, ready to drop into a spreadsheet, a calculator or a statistics tool.

How to pull numbers out of text

  1. 1

    Paste the source

    Drop in the text, no matter how dirty: surrounding words and punctuation are ignored.

  2. 2

    Choose precision

    Toggle "Include decimals" to capture `3.14`, or switch it off to extract only whole integers like `42`.

  3. 3

    Run the extractor

    Every match is pulled, unique values are kept, and you get the count of distinct numbers found.

  4. 4

    Copy the list

    One number per line, ready to paste into Excel, Numbers or any column-based tool.

What the matcher recognizes

The regex used is /-?\d+(?:\.\d+)?/ when decimals are enabled and /-?\d+/ otherwise. That covers the common numeric shapes without getting lost in locale ambiguity.

Examples of captured values

Input Captured (decimals ON)
Total: $1299.99 after tax 1299.99
Temperature dropped to -4.5C -4.5
Version 2.1.3 released today 2.1, 3
IDs: 001, 042, 1007 001, 042, 1007
Score: 87% pass 87

What it does not try to handle

  • Thousand separators. 1,234.56 is extracted as 1 and 234.56. Clean separators first if you need the full number.
  • European decimal comma. 3,14 is read as 3 and 14. Swap commas for dots before extraction.
  • Scientific notation. 6.02e23 returns 6.02 and 23. Parse the raw source yourself if you need the exponent form.
  • Fractions. 1/2 becomes 1 and 2, not 0.5.

Useful downstream moves

  • Drop the list into a statistics tool to get mean, median and standard deviation.
  • Sort and deduplicate with sort | uniq to find the distinct values in a log.
  • Compare two extractions side by side to spot missing line items in an invoice.

Frequently Asked Questions

It ignores them and returns only the numeric portion. $1,299.99 becomes 1 and 299.99 because the comma is not treated as a thousands separator. Strip commas from the source if you want 1299.99 in one piece.

The regex captures the digit sequence literally, so 007 stays 007. This matters when the numbers are really IDs, part codes or zip codes rather than arithmetic values.

By default duplicates are removed so you get a clean, distinct list. If you need the raw order-preserved stream, take the source through a grep-style pipeline instead.

The text is processed inside the request and not stored after the response; your input does not persist anywhere.

Related Tools

Tool available in other languages