Number Extractor
Work out every number in a piece of text, with a count and a total from the text in the box. A number is an optional minus sign, digits with optional thousands separators, and an optional decimal part, and the page prints the substitution so the result can be checked by hand.
Number Extractor
Work out every number in a piece of text, with a count and a total from the text in the box. A number is an optional minus sign, digits with optional thousands separators, and an optional decimal part, and the page prints the substitution so the result can be checked by hand.
How this page computes
A number is an optional minus sign, digits with optional thousands separators, and an optional decimal part
A thousands separator is removed before parsing, so 1,250.50 reads as 1250.5. A minus sign immediately before a digit is part of the number; a dash with a space after it is not.
The extraction is lexical: it finds the numbers as written and does not try to decide which of them are quantities and which are identifiers.
The calculation runs entirely in this browser tab; nothing is uploaded.
Number Extractor computes every number in a piece of text, with a count and a total. A number is an optional minus sign, digits with optional thousands separators, and an optional decimal part. The page prints the rule, the numbers substituted into it and the result, so the arithmetic can be checked by hand.
A thousands separator is removed before parsing, so 1,250.50 reads as 1250.5. A minus sign immediately before a digit is part of the number; a dash with a space after it is not. Pressed with the sample text, it answers: Numbers found: 4
How to use Number Extractor
Paste the input into the box, then press Run: the page evaluates every number in a piece of text, with a count and a total and prints every line of the working. Typed input is read exactly as written, and a blank field is refused with its name.
Read the first line as the answer and the lines below it as the substitution. If a value is out of range the page refuses it by field and reason instead of printing a number.
With the sample text, the answer is Numbers found: 4.
What counts as a number
A thousands separator is removed before parsing, so 1,250.50 reads as 1250.5. A minus sign immediately before a digit is part of the number; a dash with a space after it is not.
The extraction is lexical: it finds the numbers as written and does not try to decide which of them are quantities and which are identifiers.
What to Expect
Best for
- Working out every number in a piece of text, with a count and a total without a spreadsheet
- Checking a figure someone else quoted
- Seeing the formula behind an answer
Not ideal for
- Text with no numbers is refused, rather than reported as an empty list with a zero total.
- A quantity the page cannot compute, which it refuses instead of estimating
- Rounding an answer that has an exact form
What this tool keeps
- A number is an optional minus sign, digits with optional thousands separators, and an optional decimal part
- Every input exactly as typed
What may need cleanup
- Nothing: the printed answer is the final output
- A unit conversion, if the inputs were entered in different units
Common errors
- Text with no numbers is refused, rather than reported as an empty list with a zero total.
- An empty field is refused with the field's name
Example use cases
- Work out every number in a piece of text, with a count and a total for one set of inputs
- Check the result against the formula by hand
- See which input the answer is most sensitive to
Sample input
Number Extractor: the sample text
Sample output
Numbers found: 4 — Values: 1024, 1250.5, 87.54, -12
Who this is for
- Students checking a formula
- Anyone who needs the number and the working
Frequently asked questions
What formula does this page use?
A number is an optional minus sign, digits with optional thousands separators, and an optional decimal part. The page prints the substitution as well, so the answer can be checked against the rule.
What does Number Extractor refuse?
Text with no numbers is refused, rather than reported as an empty list with a zero total.
What does the default example give?
The sample text gives Numbers found: 4. Every line below that restates the same arithmetic.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.