Extract number

Pull plain decimal tokens from prose and optionally turn a trailing percent sign into a decimal proportion.

freeworks offlinenothing uploaded
ToolNumber Extractor
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

A configurable regular expression recognizes ASCII digits with an optional minus sign and optional dot fraction. Percentage mode divides only percent-suffixed matches by 100, then all collected values feed integer and float lists plus a three-decimal sum and mean.

  • Negative and fractional forms are enabled initially because ordinary measurements and costs use both.
  • Percent conversion starts off, leaving 25% as the visibly written number 25 unless a proportion is requested.

Worked example

Extract numbers from text
Pull out all numeric values from a sentence
Input
											The server has 16 cores, 64GB RAM, and costs $12.50/hour.
										
Output
												Numbers: 16, 64, 12.5
Integers: 16, 64
Floats: 12.5
Count: 3
Sum: 92.5
Average: 30.833
Min: 12.5
Max: 64
											

When to use this

Invoice notes yield quantities and prices, capacity descriptions expose core and memory figures, and survey summaries convert percentages into proportions.

Edge cases

  • 1,234 becomes two values, 1 and 234, because comma thousands separators are outside the decimal grammar.
  • 1e6 becomes 1 and 6 because scientific notation is not parsed as one token.
  • With conversion selected, -20% produces -0.2 once instead of producing both -20 and -0.2.