Extract Numbers
Extract numbers from text.
About this tool
Paste text and press Run to list every number in it, one per line. Whole numbers, decimals and negatives are all picked up.
How to use
How it works
A number is an optional minus sign, digits, and an optional decimal part. Commas are not treated as part of a number, so 1,200.50 is read as 1 and 200.50. Dates split too, and a hyphen before digits is read as a minus sign.
Worked example
Prices, a negative and a date
- Input
- Price 1,200.50 and -3.5 plus 42 items, 2024-05-01
- Output
- 1 200.50 -3.5 42 2024 -05 -01
- Walkthrough
- The comma splits 1,200.50. The date 2024-05-01 splits into 2024, -05 and -01 because each hyphen reads as a minus sign.
Limitations
- Thousands separators and dates are split into pieces.
- Percent signs and currency symbols are not included in the numbers.
- Numbers written as words are not found.
Questions
How do I pull numbers out of text?
Why was 1,200 split into 1 and 200?
Does it find negative numbers?
Features
- Integers, decimals, negatives
- One per line
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
HTML Crash Course For Absolute Beginners
Traversy Media
Text on the web often starts as HTML you clean or count.
Watch on YouTubeLearn JSON - Full Crash Course
freeCodeCamp.org
Structured text formats often sit next to plain-text tools.
Watch on YouTube
- Unicode Normalization Forms
Unicode
Why seemingly identical characters break equality checks.
- String
MDN
JS string methods that mirror case, trim, and split tools.