Extract Numbers from Text Tool

Find and extract all numbers from your text with advanced filtering options

How to Use Extract Numbers from Text Tool

Our free online tool is built for simplicity and power. As a data analyst, researcher, or student, you may extract numerical data from any text in seconds. Follow these simple steps to start and unleash the full potential of your textual data.

  1. Enter Your Text Type or paste your text into the main text input box. You can also use the "Upload File" button to process .txt, .csv, .log or .md files directly.
  2. Configure your Extraction Set up advanced filtering options to personalise the results per your requirements.
    • Eliminate duplicate numbers
    • Ascending/Descending Sort
    • Decimal numbers support
    • Include negative numbers
    • show percentage
  3. Extract and Review Click the “Extract Numbers” button. All numbers that fit your criteria will pop up in the results box immediately. You will see how many there are above the box.
  4. Export Your Data Use the toolbar to copy the list to your clipboard, download to a file, or export in several formats, including CSV, JSON or as a comma-separated list for use in other applications.

Top 10 Use Cases of a Number Extractor

Number extraction from text is a basic operation in many professions. This technology takes a tiresome manual procedure and automates it, saving hours of work and decreasing human error. Discover how professionals use this skill to boost productivity and unlock insights.

  • Data Analysis and Research: Efficiently extract numbers from survey answers, academic publications, or interview transcripts for statistical analysis.
  • Financial Auditing: Pull out dollar numbers, percentages, and transaction IDs from financial documents, invoices, or bank statements.
  • Web Scraping & SEO: Collect pricing, ratings, and statistics from HTML code or competing sites for market research.
  • Log File Analysis: Extract error codes, timestamps, and performance metrics (e.g., latency in ms) from server or application logs.
  • Academic Writing: Verify all citations, statistical and numerical references from an extended research paper.
  • Programming & Debugging: Extract numeric constants, IDs or version numbers from source code or config files.
  • Content Migration: Use embedded numbers to identify content when migrating between systems to maintain data integrity (e.g., product catalogs).
  • Legal Document Review: Quickly search for dates, clause numbers, and financial penalties in contracts or legal documents.
  • Social Media Monitoring: Extract engagement metrics (likes, shares) and poll results from compiled social media reports.
  • Sorting Personal Data: Take a bunch of personal notes and documents containing phone numbers, addresses, dates or serial numbers and extract them.

How It Works: Input Vs Output Demo

The trick is to work out how the magic happens to take the raw text and create a neat list of numbers. Here is a practical example with a sample input text and the output created by our program with default settings turned on.

Input Text (Example)Extracted Numbers (Output)
The Q3 report showed revenue of $1,250,500.75, up 15.5% from last quarter. We processed 1,000,000 transactions, but had 12 errors (error rate: 0.0012%). Customer scores averaged 4.7 out of 5. The project ran from 2023-01-15 to 2023-04-15. Key IDs: 455, 782, and 455 again.
1250500.75
15.5
1000000
12
0.0012
4.7
5
2023
1
15
2023
4
15
455
782

Note: The second "455" has been excluded as the "Remove duplicates" option has been selected. Percentages are captured as the decimal part (15.5, not 15.5%). Dates are split into their component numbers.

Extraction Logic & Options Explained

The program utilises a powerful regular expression (regex) engine to find numeric patterns in text. The filtering options provide you with very fine control over the patterns that are included in your final list, and so allow very fine-grained data extraction.

Core Number Detection Patterns

The engine is trained on a large variety of numerical representations often found in text. This ensures total extraction without missing important data concealed within complex strings.

  • Integers: Whole numbers, e.g., `42`, `-7`, or `1,000,000` (commas are handled).
  • Decimal Numbers: Numbers with a fractional part, for example `3.14159`, `-0.005` or `99.99`.
  • Percentages: Numbers that end with a percent sign. When the option is checked, `25%` is parsed to `25`.
  • Numbers in Context: Numbers that are associated with symbols or units, such as `$50`, `45°C`, or `Version 2.1`.
  • Scientific Notation: Accepts formats like `6.022e23` or `1.6E-19` for complex scientific data.

Find Out More About Advanced Filter Options

With these options, you can clean and organise the extracted data in the program itself without the requirement of cleaning it in a spreadsheet.

  • Remove Duplicate Numbers: Provides the initial occurrence of each specific number, vital for generating unique lists for analysis.
  • Sort Order: Sort numbers in ascending (smaller to larger) or descending order to see the numbers at a glance and identify trends.
  • Include Decimal Numbers: Enables or disables the extraction of floating-point numbers. Disable to get only integers.
  • Allow Negative Numbers: Indicates whether to include numbers with a minus sign (`-`) in the results.
  • Include Percentages: Determines whether integers formatted as percentages are captured as their numeric value.
  • Upload File: Batch processing of numbers from complete documents in several plain-text formats.

Export Formats and Data Usefulness

Extracted data is only as good as your capacity to use it elsewhere. Our application offers a variety of export choices so you can easily get the numbers into your current workflow, whether for software development, reporting, or data visualisation.

Export formats supported

Pick the format that fits your next step. Each format is meant to be used with popular software and programming languages.

  • CSV Format: Generates a standard Comma-Separated Values file that is excellent for importing into Excel, Google Sheets, or database systems.
  • JSON Format: Exports numbers as a JSON array (e.g., [1, 2, 3.5]), good for web applications and APIs.
  • Comma Separated: A basic list like `1, 2, 3.5` ready to paste into code or a list input box.
  • Semicolon Separated: A list such as `1; 2; 3.5`, which is an alternate separator used in European CSV files.
  • One Per Line: Each number on its own line, the cleanest format for readability or for use as input to command line tools.
  • Copy to Clipboard: Copy the results in your selected display format instantly for fast pasting.
  • Download as .TXT: Downloads a plain text file with the extracted numbers.
  • Statistics: Provides a short overview of the extracted set, including count, sum, average, and min/max.

Integration Tips

Use these procedures to integrate the retrieved data into your projects, to maximise efficiency.

  • To feed directly into JavaScript/Python applications, use JSON export.
  • Create charts in a spreadsheet program with CSV export.
  • Use One Per Line format to easily build arrays in code by adding brackets and commas.
  • Use the Statistics tool to get a short description analysis before going deeper.
  • Combine with Upload File to batch-process numerous documents and export the combined results.

How to Properly Extract Numbers

A little preparation and a good grasp of how the tool works can go a long way to getting you a flawlessly clean dataset. Read on for suggestions on handling edge circumstances and complex text issues.

Pre-process Your Text

Cleaning your input wording a bit can substantially increase the relevance of your results.

  • Remove or handle non-standard number separators (e.g., European `1.000,50` will be processed as `1.000` and `50`).
  • For cleaner output, you may want to consider stripping off units (`kg`, `$`, `px`) before extracting, if you want simply freestanding numbers.
  • For dates, you have the option to pick if you want the parts (2023, 04, 15) or the complete string. The tool separates the components.
  • Long, unbroken material is OK, but occasionally it can be easier to verify results if you divide it into logical paragraphs.

Management of Special Cases

Our tool is powerful, but knowing how it acts in certain circumstances will help you interpret the output.

  • Phone Numbers & IP Addresses: These are parsed as a sequence of numbers (e.g., `192.168.1.1` becomes `192`, `168`, `1`, `1`).
  • Alphanumeric Codes: For example, the code `AB123CD` will return `123`. The letters are disregarded.
  • Fractions: Simple fractions like `1/2` could be extracted as `1` and `2` individually, rather than `0.5`.
  • Roman Numerals: These don't count as numbers (e.g., "Chapter IV" won't extract `4`).

Workflow after extraction

After extraction, you can process your data further for final use.

  • Use the Sort function to quickly discover outliers or data that is sequenced.
  • Count unique items by using Remove Duplicates to create a list of unique values.
  • Export to CSV and use spreadsheet functions like SUM, AVERAGE, or FILTER for advanced analysis.
  • For programming: import the JSON or line-seperated output directly into a list/array variable.

Frequently Asked Questions (FAQs)

Below are answers to the most frequently asked questions concerning the Extract Numbers from Text tool. If you have a query that we haven’t covered here, try the “Show Example” button to see it in action.

General Usage

Frequently asked questions about the tool’s capabilities and usage.

  • Is this tool free to use? Yes, it’s completely free to use and no registration is required.
  • Are there any limits or costs? No, there are no hidden costs or limits.
  • Is my data secure? Absolutely. All processing is done in your browser. Your text is never transferred to our systems, so you are fully private.
  • Maximum text length? It can handle very huge texts (millions of characters), although really large inputs may slow down your browser for a while.
  • Can I pull numbers out of a PDF? Not really. First, you need to copy the text from the PDF and paste it into the tool, or convert the PDF to a .txt file and upload it.

Technology Specifications

Questions about the extraction logic, formats and technical details

  • Can it work with numbers with commas – like 1,000? Yes, commas are treated as a thousands separator and interpreted correctly. So `1,000` becomes `1000`.
  • What about negative integers in brackets? Numbers such as `($125)` are taken as `-125` if the "Include negatives" option is selected.
  • How about scientific notation? Yes, formats such as `5.6e3` (5600) are understood and extracted.
  • Does it pull numbers from HTML code? Yes, however, it will also pick up numbers from tags and attributes (e.g., `width="100"`). For clearer results, try reading the page as text first.
  • Why don’t I see a number in my results? Verify your filter settings. It could be a decimal, a negative, or a percentage that you decided not to include.

Export and Output

Questions on the results and how to use them after extraction.

  • Can I export the original text with the numbers highlighted? No, this tool extracts only the numbers and outputs them, not any surrounding text.
  • What is the purpose of the "Statistics" button? The extracted number set is then used to compute basic metrics like count, sum, average (mean), lowest and maximum value.
  • The CSV file opens in one column in Excel. This is normal. In Excel, use the “Text to Columns” function and use the comma delimiter to separate the numbers into different cells.
  • Can I select a custom delimiter while exporting? The default options (comma, semicolon, new line) should suit most frequent use scenarios. For custom delimiters, use "One Per Line" and replace the newlines in a text editor.
  • Does this tool have an API? We don't have a public API yet. The tool is meant to be used manually via a web interface.