# Extract IP Addresses From Text, Logs and Reports

Extract IPv4 and IPv6 addresses from text (up to 1 MB): logs, emails, threat reports. Reads defanged forms such as 1.2.3[.]4 and 1(.)2(.)3(.)4 when refang is on, ip:port, bracketed IPv6 and CIDR blocks. Returns each address once with a count and the lines it appears on (or every mention), its kind (private, shared, documentation, global and so on), a summary by family and kind, the near misses that were left out on purpose (an address inside a longer version string, octets out of range) with the reason, and the first 20 lines that hold a hit, clipped. Optional sort. Pure computation: the text is not stored or logged.

**Not for:** Looking addresses up (use ip_whois or ip_location) or merging blocks (use cidr_aggregate).

- Tool id: `ip-extract`
- Category: ip
- Execution: pure
- MCP tool `ip_extract` at https://lookupowl.com/mcp
- REST `GET https://lookupowl.com/api/v1/tools/ip-extract` (or POST a JSON body)
- OpenAPI: https://lookupowl.com/api/openapi.json

## Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `text` | string | yes |  | Logs, an email or a report, up to 1 MB (the web page takes 10 MB in your browser). Never stored. min length 1, max length 1048576 |
| `refang` | boolean | no | `true` | Read defanged addresses such as 1.2.3[.]4 and 1(.)2(.)3(.)4 as the real address. |
| `versions` | "4" \| "6" \| "both" | no | `"both"` | Which address families to return. |
| `unique` | boolean | no | `true` | Return each address once, with a count of how often it appears. |
| `sort` | boolean | no | `false` | Sort numerically instead of in order of first appearance. |
| `includeCidr` | boolean | no | `true` | Also find blocks written with a prefix length, such as 10.0.0.0/8. |
| `classify` | boolean | no | `true` | Say what kind each address is (private, shared, documentation, global, and so on). |

## Output

Results are wrapped in an envelope: `tool`, `version`, `requestId`, `data`, `summary`, `meta` (cache status, timing), `permalink`. `data` has these fields:

| Field | Type | Description |
|---|---|---|
| `summary` | object |  |
| `items` | object[] |  |
| `nearMisses` | object[] | Things that looked like addresses and were left out on purpose, with the reason. At most 100. |
| `lines` | object[] | The first 20 lines that hold a hit. |
| `options` | object |  |
| `hostnames` | object | When no address was found: how many host names the text holds and the first few, so the page can point to DNS lookup. null otherwise. |
| `progress` | object | Only the browser worker reports progress. |
| `truncated` | boolean | The result list was cut at 10,000 addresses. |

## Examples

### A made-up log with defanged addresses

```json
{"text":"203.0.113.45 - - [23/Nov/2026:10:02:11 +0000] \"GET /login HTTP/1.1\" 401 512\n203.0.113.45 - - [23/Nov/2026:10:02:12 +0000] \"POST /login HTTP/1.1\" 200 1024\nsrc=198.51.100.7 dst=10.0.0.12 proto=tcp action=allow\nclient [2001:db8:abcd::17] connected\nproxy 100.64.9.1:443 forwarded for 192.168.1.20:52144\nIOC: 192.0.2[.]99 and 198[.]51[.]100[.]23 contacted hxxp://bad[.]example/\nbuilt with OpenSSL 1.1.1.1 (bogus 300.1.2.999)","refang":true,"versions":"both","unique":true,"sort":false,"includeCidr":true,"classify":true}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/ip-extract?classify=true&includeCidr=true&refang=true&sort=false&text=203.0.113.45+-+-+%5B23%2FNov%2F2026%3A10%3A02%3A11+%2B0000%5D+%22GET+%2Flogin+HTTP%2F1.1%22+401+512%0A203.0.113.45+-+-+%5B23%2FNov%2F2026%3A10%3A02%3A12+%2B0000%5D+%22POST+%2Flogin+HTTP%2F1.1%22+200+1024%0Asrc%3D198.51.100.7+dst%3D10.0.0.12+proto%3Dtcp+action%3Dallow%0Aclient+%5B2001%3Adb8%3Aabcd%3A%3A17%5D+connected%0Aproxy+100.64.9.1%3A443+forwarded+for+192.168.1.20%3A52144%0AIOC%3A+192.0.2%5B.%5D99+and+198%5B.%5D51%5B.%5D100%5B.%5D23+contacted+hxxp%3A%2F%2Fbad%5B.%5Dexample%2F%0Abuilt+with+OpenSSL+1.1.1.1+%28bogus+300.1.2.999%29&unique=true&versions=both'
```

Web page: https://lookupowl.com/extract-ip-addresses

### A list of blocks, sorted

```json
{"text":"allow 198.51.100.0/24; allow 203.0.113.0/25; deny 192.0.2.0/24; 2001:db8::/32","refang":true,"versions":"both","unique":true,"sort":true,"includeCidr":true,"classify":true}
```

```bash
curl 'https://lookupowl.com/api/v1/tools/ip-extract?classify=true&includeCidr=true&refang=true&sort=true&text=allow+198.51.100.0%2F24%3B+allow+203.0.113.0%2F25%3B+deny+192.0.2.0%2F24%3B+2001%3Adb8%3A%3A%2F32&unique=true&versions=both'
```

Web page: https://lookupowl.com/extract-ip-addresses?sort=true

## Web pages

- https://lookupowl.com/extract-ip-addresses

## Limits and caching

- Cost: from 1 unit up, depending on the input (a registry lookup counts every upstream request); 1 unit for a cached result. Budgets are per network and published in the `RateLimit` response headers.
- Cache: results are never cached.
- Timeout: 10 s.

## Related tools

- [IP Address Type Checker: Private, CGNAT or Public?](https://lookupowl.com/tools/ip-classify.md): Check what kind an IP address or block is: private, shared (CGNAT), link-local, documentation, multicast, reserved or public, with the RFC.
- [IP Address Validator: Strict Check and Parser Differences](https://lookupowl.com/tools/ip-validate.md): Validate IP addresses strictly, and see how browsers, curl and strict libraries each read them, including internal addresses in disguise.
- [CIDR Aggregator: Merge IPs and Ranges into CIDR Blocks](https://lookupowl.com/tools/cidr-aggregate.md): Merge a messy list of IPs, ranges and CIDRs into the fewest exact CIDR blocks, with optional exclusions and firewall-ready exports.
- [IP in CIDR: Is This Address in That Block?](https://lookupowl.com/tools/cidr-contains.md): Check which IP addresses fall inside which CIDR blocks, and whether two lists of blocks overlap.
- [IP Location Lookup](https://lookupowl.com/tools/ip-location.md): Where an IP address is: city, region, country and the network that runs it, from DB-IP, with an honest accuracy note.

## Guide: Extract IP addresses from text

Paste a log, an email or a report and get every IP address in it, each once, with how often it appears and what kind it is, read in your browser.

### What it finds

The extractor reads your text with a scanner, not one giant search pattern, so a large log stays quick and a hostile paste cannot make it hang. It finds:

- IPv4 addresses, with or without a port: `203.0.113.45` and `100.64.9.1:443`.
- IPv6 addresses in any form: compressed (`2001:db8::17`), in brackets with a port (`[2001:db8::1]:443`), with an IPv4 tail (`::ffff:192.0.2.1`) or with a zone (`fe80::1%eth0`).
- Blocks written with a prefix length: `10.0.0.0/8` and `2606:4700::/32`. Turn this off and the prefix is dropped, so you get the address alone.
- Defanged addresses, the way threat reports write them so a link cannot be clicked by mistake: `192.0.2[.]99`, `198(.)51(.)100(.)23` and `hxxp://198[.]51[.]100[.]23/`. They are read back as the real address, and the row says what was written.

Each address is listed once with a count and the first lines it appears on, and has a kind: public, private, shared (carrier-grade NAT), documentation, loopback, link-local, multicast and so on. The kinds come from the IANA special-purpose registries; the [IP type checker](https://lookupowl.com/ip-address-type-checker) explains each one.

### What it leaves out on purpose

A log is full of numbers that look like addresses and are not. The extractor lists them apart, under "things that looked like addresses and were left out", each with one reason, so you can see what was skipped and copy any of it by hand:

- A version string: `OpenSSL 1.1.1.1` is four numbers, but it is a version, not an address. A short list of words before the number (version, build, release, openssl and a few more) gives it away.
- A number above 255: `300.1.2.999` cannot be an address.
- Three numbers or five: `10.0.12` is missing a part, and `1.2.3.4.5` has one too many.
- A leading zero: `010.1.1.1` is read as octal by some programs (it would be 8.1.1.1), so it is not reported as an address. The [IP validator](https://lookupowl.com/ip-validator) shows how each program reads it.
- A number stuck to letters or to a longer name.

### Where your text goes

With JavaScript on, the text is read in your browser and nothing you paste or drop is sent to us or saved. It works offline. Big input (over about 1 MB) is read in a separate worker so the page stays usable, with a status line and a Cancel button.

Without JavaScript the form sends your text to our server for that one request. We read it, show the result and keep nothing: it is not stored, not logged and not cached, and the page address has no query. Logs often hold other people's addresses, which is why the browser path is the default.

### Limits and options

| Where | Text | Results |
|---|---|---|
| In your browser | Up to 10 MB | First 10,000 addresses listed; the counts cover all of them |
| Without JavaScript, API and MCP | Up to 1 MB | Up to 10,000 addresses |

Options: read defanged addresses, IPv4 only or IPv6 only, each address once (with a count) or every mention, sort by address instead of order of appearance, find blocks, and say what kind each address is. For scripts and AI assistants the same tool is `ip_extract` on the API and over MCP.

### What to do with the list

- Merge blocks into the fewest with the [CIDR aggregator](https://lookupowl.com/cidr-aggregator).
- Sort the addresses into private and public with the [IP type checker](https://lookupowl.com/ip-address-type-checker).
- Look up who runs a public address with [IP lookup](https://lookupowl.com/ip-lookup).

Nothing is carried from the text to those tools: copy the addresses and paste them there.

### Frequently asked questions

**What is a defanged address?**

A defanged address has its dots wrapped, as in `1.2.3[.]4`, so it is not clickable and a filter does not match it. Threat reports write them this way. The extractor turns them back into the real address and says it did.

**How much text can it read?**

Up to 10 MB in your browser, and up to 1 MB without JavaScript or over the API. A list longer than 10,000 addresses is cut there and says so; the counts still cover all of it.

**Why was an address left out?**

It looked like one but was not: a version string, a number above 255, a missing or extra part, a leading zero or a number stuck to letters. Each is listed with its line and the reason.

**Is my log sent anywhere?**

Not with JavaScript on: it is read in your browser. Without JavaScript it goes to our server for one request and is not kept.

**Does it find IPv6 addresses?**

Yes, in every written form: compressed, with brackets and a port, with an IPv4 tail, and with a zone. Short ones such as `a::b` are reported too, with the line number and kind so you can judge.
