IP address extractor

Extract IPv4 and IPv6 addresses from logs or any text. Remove duplicates, sort numerically, keep or strip ports.

Your text is processed in your browser and never sent to our server.

0 characters · 0 words · 0 lines

How to extract IP addresses from text

Server logs, firewall reports and e-mail headers are full of IP addresses mixed with timestamps, ports and version numbers. This tool finds every valid IPv4 and IPv6 address in any text and lists them for you.

  1. Paste your text into the left box, open a file or drop a .log / .txt file onto it.
  2. The IP addresses appear instantly on the right – nothing is uploaded.
  3. Adjust the options below if needed.
  4. Copy the list, download it as a .txt file or send it to another tool.
  • Find – extract only IPv4, only IPv6, or both.
  • Unique only – every address is listed once (on by default). Turn it off to count how often an address appears, e.g. failed logins from the same IP.
  • Sort numerically – sorts IPv4 addresses by their numeric value (10.0.0.9 comes before 10.0.0.10), followed by IPv6.
  • Keep ports – 10.0.0.12:8080 stays as it is; when unchecked only 10.0.0.12 is kept.
  • Separate with – one address per line, or a comma / space separated list ready for a firewall rule or a spreadsheet cell.

Example

Input – a fragment of a server log:

Failed password for root from 203.0.113.45 port 52144
upstream 10.0.0.12:8080 timed out
app v2.4.1 build 1.2.3.4.5
bad value 999.1.1.1
client [2001:db8::7334]:443 connected

Result with the default options:

203.0.113.45
10.0.0.12
2001:db8::7334

The version number 2.4.1, the five-part build number and 999.1.1.1 (an octet above 255) are ignored. With Keep ports checked you would get 10.0.0.12:8080 and [2001:db8::7334]:443 instead.

Frequently asked questions

How does the tool tell an IP address from a version number?

An IPv4 address must have exactly four parts and each part must be between 0 and 255. Values like 1.2.3, 1.2.3.4.5 or 999.1.1.1 are skipped, and so are numbers glued to letters. IPv6 addresses are validated against the full IPv6 rules, so times such as 12:30:45 or MAC addresses are not matched.

How do I extract IP addresses from a log file in Excel or Google Sheets?

In Google Sheets you can use =REGEXEXTRACT(A1, "\d+\.\d+\.\d+\.\d+"), but it returns only the first match per cell and does not check the 0–255 range. Excel has no built-in regex in older versions. It is usually quicker to paste the whole column here, copy the result and paste it back.

How can I count how many times each IP appears?

Uncheck Unique only to get every occurrence, then paste the list into a spreadsheet and use a pivot table, or compare it with another list using our list compare tool. To get just the unique ones again, use the duplicate remover.

Does it find IPv4-mapped IPv6 addresses and zone IDs?

Yes. ::ffff:192.0.2.1 is returned as one IPv6 address (the IPv4 part is not listed twice) and link-local addresses keep their zone, e.g. fe80::1%eth0.

Is it safe to paste server logs here?

Yes. The extraction runs entirely in your browser with JavaScript. Your text is never sent to our server, so you can safely paste logs that contain internal addresses.