Extract IPs from Text
Extract IP addresses from logs or text snippets
Input Text
Extracted IPs
Extracted IPs will appear here
The Extract IPs from Text tool scans any unstructured text -- log files, configuration snippets, threat reports, emails, or documentation -- and pulls out every valid IPv4 and IPv6 address. Paste a block of text and get a clean, deduplicated list showing each unique address and how many times it appears, ready for analysis, blocking, or allowlisting.
Understanding IP Address Extraction
Network engineers and security analysts spend a surprising amount of time copying IP addresses out of unstructured text. A threat intelligence report lists indicators of compromise buried in paragraphs of prose. An incident ticket contains server logs pasted inline with commentary. A vendor sends an email listing the IP ranges for their API endpoints. In each case, you need the addresses pulled out cleanly so you can add them to a blocklist, feed them to a SIEM, or compare them against your existing inventory.
Doing this manually is tedious and error-prone. You scan through the text, mentally distinguish IP addresses from version numbers (is 2.4.51 an address or a version?), copy each one, check for duplicates, and try to catch the ones embedded in URLs or buried at the end of a long log line. Miss one address in a threat report and you leave a gap in your defenses. Include a version number by mistake and you block a legitimate destination or create a nonsense firewall rule.
This tool automates the entire process. It uses context-aware pattern matching to distinguish real IP addresses from look-alikes, validates each match against the correct family's rules, deduplicates the results, and counts occurrences. The output is a clean list sorted by frequency or numeric order, ready to be used directly. It handles both IPv4 and IPv6, including compressed notation, IPv4-mapped addresses, and addresses with CIDR prefixes -- all the formats you encounter in real-world text.
How to Extract IP Addresses from Text
- Paste or enter any text containing IP addresses (log lines, config files, prose, HTML, CSV, etc.)
- The tool scans the input using pattern matching tuned to distinguish real IP addresses from version numbers and other numeric strings
- View the extracted list of unique IPv4 and IPv6 addresses
- Optionally filter by address family (IPv4 only, IPv6 only, or both) and sort by frequency or numeric order
Extraction Examples
Input: Apache Access Log
10.0.0.5 - - [07/Mar/2026:14:22:01 +0000] "GET /api/status HTTP/1.1" 200 1234
192.168.1.100 - - [07/Mar/2026:14:22:02 +0000] "POST /api/data HTTP/1.1" 201 567
10.0.0.5 - - [07/Mar/2026:14:22:03 +0000] "GET /api/health HTTP/1.1" 200 89
2001:db8::face - - [07/Mar/2026:14:22:04 +0000] "GET / HTTP/1.1" 200 4521
Extracted output:
| IP Address | Count |
|---|---|
10.0.0.5 | 2 |
192.168.1.100 | 1 |
2001:db8::face | 1 |
Input: Firewall Configuration Snippet
allow from 203.0.113.0/24
deny from 198.51.100.50
allow from 2001:db8:abcd::/48
allow from 10.10.0.0/16
deny from 192.0.2.100
Extracted output:
| IP Address | CIDR |
|---|---|
203.0.113.0 | /24 |
198.51.100.50 | -- |
2001:db8:abcd:: | /48 |
10.10.0.0 | /16 |
192.0.2.100 | -- |
Input: Mixed Prose and Technical Data
The server at 10.0.0.1 reported issues connecting to the database
at 172.16.5.20 on port 5432. The external API endpoint 203.0.113.99
returned HTTP 503. Version 2.4.51 of the application was deployed.
Extracted output: 10.0.0.1, 172.16.5.20, 203.0.113.99
Note that 2.4.51 is correctly excluded -- it is a version number, not an IP address.
When to Use IP Extraction
- Incident response -- quickly pull all IP addresses from a threat intelligence report or incident log to build blocklists
- Log analysis -- extract source and destination IPs from raw log files for frequency analysis or correlation
- Configuration auditing -- pull all referenced IP addresses from firewall rules, DNS configs, or infrastructure-as-code templates
- Security research -- extract indicators of compromise (IOCs) from malware analysis reports or phishing emails
- Migration planning -- collect all IP addresses mentioned in network documentation to build an inventory
- Compliance review -- identify all IP addresses referenced in audit logs for access pattern analysis
How IP Extraction from Text Works
The extraction engine uses targeted pattern matching with validation to avoid false positives.
IPv4 Extraction Logic
The tool looks for patterns matching N.N.N.N where each N is a 1-3 digit number between 0 and 255. Additional validation includes:
- Octet range checking -- rejects matches where any octet exceeds 255 (e.g.,
192.168.1.300is not extracted) - Context awareness -- distinguishes IP addresses from version numbers by examining surrounding characters;
v2.4.51.1is not treated as an IP - Boundary detection -- ensures the match is not part of a longer numeric string or embedded in a domain name in a way that creates a false match
IPv6 Extraction Logic
IPv6 detection handles all standard notations:
- Full expanded form (
2001:0db8:0000:0000:0000:0000:0000:0001) - Compressed form (
2001:db8::1) - Mixed notation (
::ffff:192.168.1.1) - Link-local with zone IDs (
fe80::1%eth0)
CIDR Handling
When an address includes a CIDR prefix length (e.g., 10.0.0.0/24), the tool can either extract just the address portion or preserve the full CIDR notation, depending on your selection.
False Positive Prevention
The most challenging aspect of IP extraction is avoiding false positives. The pattern N.N.N.N matches many things that are not IP addresses: software version numbers (2.4.51.3), decimal-separated identifiers, and numeric codes. The tool uses several heuristics to minimize false matches:
- Strings with only three numeric groups are rejected (they cannot be IPv4)
- Context keywords like
version,v,releasenear the match reduce its likelihood of being an address - Matches embedded within longer alphanumeric strings are excluded
- In ambiguous cases, the tool errs on the side of inclusion, since missing a real address (false negative) is usually worse than including a non-address (false positive) in security contexts
Practical Tips for IP Extraction
When working with large volumes of text, the frequency count is one of the most valuable outputs. In a log file, the most frequently appearing IP addresses are often the most significant -- they may be the source of an attack, the target of repeated requests, or a misconfigured client hammering an endpoint. Sorting by frequency immediately highlights the addresses that deserve investigation first, without requiring you to read through thousands of log lines.
For threat intelligence work, the extraction step is typically followed by enrichment: once you have a clean list of addresses, you look up each one in reputation databases, geolocation services, and WHOIS records. The deduplicated output from this tool is the ideal input for that enrichment pipeline. Feed it into your SIEM, a script that queries VirusTotal or AbuseIPDB, or a spreadsheet where you track indicators. The cleaner your extraction, the more accurate your enrichment.
Be cautious with IPv4 addresses that appear in unexpected contexts. An address like 1.2.3.4 in a configuration file might be a placeholder, test value, or example rather than a real address in use. The documentation ranges (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24) are specifically reserved for examples. If you are building a blocklist from extracted addresses, verify that you are not including documentation or test addresses that would cause unintended blocking.
Frequently Asked Questions
How does the tool distinguish IP addresses from version numbers like 2.4.51?
The tool uses context-aware boundary detection. A string like 2.4.51 has only three numeric groups (not four) so it does not match the IPv4 pattern. Even a four-part version like 1.2.3.4 could be a valid IP, so the tool checks surrounding context -- if preceded by v, version, or similar keywords, it is less likely to be treated as an address. In ambiguous cases, the match is included since false negatives are more costly than false positives in security contexts.
Can I extract only IPv4 or only IPv6 addresses?
Yes. The tool provides filtering options to return only IPv4 addresses, only IPv6 addresses, or both. This is useful when you need to build family-specific blocklists or when one family is irrelevant to your analysis.
What is the maximum text size the tool can process?
The tool runs entirely in your browser, so the limit depends on available memory. It handles typical log files (tens of thousands of lines) without difficulty. For very large files (hundreds of megabytes), consider splitting the input or using command-line tools like grep -oE for initial extraction.
Does the tool extract addresses from URLs like http://192.168.1.1/path?
Yes. The tool recognizes IP addresses embedded in URLs, extracting the address portion while ignoring the protocol prefix and path. The address 192.168.1.1 from http://192.168.1.1/api/v1 would be extracted as a standalone IPv4 address.
How are duplicate addresses handled?
Each unique address appears only once in the output, with a count showing how many times it was found in the input text. This deduplication uses exact string matching after normalization, so 10.0.0.5 appearing 50 times in a log file results in a single entry with count 50.
Can I preserve the original context (line number, surrounding text) of each extracted address?
The primary output is a clean deduplicated list optimized for use in blocklists and configurations. For contextual analysis where you need to see which log line each address came from, consider using the extracted list as a filter to search back through the original text with your preferred log analysis tool.
Related Tools
- Normalize Mixed Lists - Sort and clean mixed IPv4/IPv6 address lists
- Address Family Detector - Detect if an address is IPv4, IPv6, or invalid
- IPv4 Private/Public Detector - Detect if IPv4 is private, public, or special
- IPv4 Validator - Validate IPv4 addresses in strict dotted-quad format
- IPv6 Validator - Validate IPv6 addresses in full and compressed formats
- IPv6 Unique Local/Link-Local Detector - Detect IPv6 address scope and type