IP in CIDR and overlap checker
Find out which addresses fall inside which blocks, and whether two lists of networks overlap before you peer or route them.
Result
Checked
3 of 4 addresses are in your blocks
198.51.100.9 is in none of them. 10.1.2.3 is in 2: lab (the most specific) and corp.
Addresses4
| Address | Most specific block | Also in | Result |
|---|---|---|---|
| 203.0.113.77 | office 203.0.113.0/24 | None | In |
| 10.1.2.3 | lab 10.1.0.0/16 |
| In |
| 198.51.100.9 | Nearest: office 203.0.113.0/24 | None | Not in |
| 2001:db8:abcd::1 | v6 2001:db8::/32 | None | In |
Do this in code
import ipaddress
ipaddress.ip_address('203.0.113.77') in ipaddress.ip_network('203.0.113.0/24') # TrueSELECT '203.0.113.77'::inet << '203.0.113.0/24'::cidr; -- trueconst toInt = (ip) => ip.split('.').reduce((n, o) => n * 256 + Number(o), 0);
const [base, bits] = '203.0.113.0/24'.split('/');
const mask = bits === '0' ? 0 : (~0 << (32 - Number(bits))) >>> 0;
(toInt('203.0.113.77') & mask) >>> 0 === (toInt(base) & mask) >>> 0; // trueWorked out on our server. With JavaScript on, it is worked out in your browser and nothing you paste is sent to us.
Structured result (JSON) · 1.3 KB
{
"mode": "contains",
"items": [
{
"item": "203.0.113.77",
"family": 4,
"matches": [
{
"name": "office",
"cidr": "203.0.113.0/24",
"prefix": 24
}
],
"position": {
"index": "77",
"size": "256"
}
},
{
"item": "10.1.2.3",
"family": 4,
"matches": [
{
"name": "lab",
"cidr": "10.1.0.0/16",
"prefix": 16
},
{
"name": "corp",
"cidr": "10.0.0.0/8",
"prefix": 8
}
],
"position": {
"index": "515",
"size": "65536"
}
},
{
"item": "198.51.100.9",
"family": 4,
"matches": [],
"nearest": {
"cidr": "203.0.113.0/24",
"name": "office"
}
},
{
"item": "2001:db8:abcd::1",
"family": 6,
"matches": [
{
"name": "v6",
"cidr": "2001:db8::/32",
"prefix": 32
}
],
"position": {
"index": "53169766472471005732752326657",
"size": "79228162514264337593543950336"
}
}
],
"overlaps": [],
"summary": {
"items": 4,
"matched": 3,
"unmatched": 1,
"blocks": 4,
"overlappingPairs": 0
},
"ignored": []
}More in IP and subnets
Next step
- CIDR aggregatorMerge your block list firstOpen in CIDR aggregator
- IP lookupWho runs the address that matched nothing?Open in IP lookup
- Subnet calculatorDetails of one blockOpen in Subnet calculator
Two questions in one page
The first question is "is this address in that block?" Paste one address and one block and you get a plain answer, with a bar that shows where the address sits between the first and last address of the block. Paste many addresses and many blocks and you get a table: each address, the most specific block that holds it, and any larger blocks around that one.
The second question is "do these networks overlap?" Put one list of networks in the first box and another list in the blocks box. For every pair that shares addresses, the page names the shared range, counts the addresses, and draws both blocks on one address axis so you can see which one sits inside which.
How to use it
- List what you want to checkPut addresses, or blocks, in the first box, one per line. Single addresses are looked up. Blocks, ranges and masks are compared for overlap.
- List the blocks to check againstAdd
203.0.113.0/24or a name before a colon, such asoffice: 203.0.113.0/24. The name then appears in the answer instead of the number. - Read the answerAn address in several blocks shows the most specific one first, because the smallest block is the one a router would pick. An address in none shows the nearest block you gave.
Checking for overlap before peering
Two networks that share addresses cannot be routed to each other without a clash. Cloud VPC peering, VPN links and company mergers all hit this. List your networks in one box and theirs in the other. If nothing overlaps, you can go ahead. If something does, you see which blocks clash and by how many addresses, which tells you how much renumbering the fix needs.
| Relation | Meaning | Example |
|---|---|---|
| Equal | Both blocks hold the same addresses | 10.0.0.0/16 and 10.0.0.0/16 |
| Inside | One block is wholly inside the other | 10.0.128.0/17 inside 10.0.0.0/16 |
| Partial | They share some addresses, each has more | Ranges 10.0.0.0-10.0.0.200 and 10.0.0.100-10.0.0.255 |
| None | They share no address | 172.16.0.0/12 and 192.168.0.0/16 |
Doing the same in code
The result page has a tab with the same check in Python, PostgreSQL and JavaScript for the values you entered. In Python, ipaddress.ip_address(x) in ipaddress.ip_network(block) does it. In PostgreSQL, inet << cidr does it, and the index on a cidr column makes it fast. An AI agent can call the cidr_contains tool through MCP for the same answer.
Where your lists go
With JavaScript on, the lists are compared in your browser and nothing you paste is sent to us. Without JavaScript the form sends them to our server in the page address, so keep them short there. The browser accepts up to 10,000 addresses against 1,000 blocks; the server takes about 3,000 addresses. See the privacy policy for the rest.
Questions people ask
How do I check whether an IP is in a CIDR range?
Put the address in the first box and the block in the second, then press Check. The answer says whether the address is inside, which address of the block it is, and the first and last address of the block.
What does most specific block first mean?
Blocks can sit inside each other: a /8 holds a /16 which holds a /24. When an address is in several, the one with the longest prefix is listed first because that is the route a router prefers.
Can I name my blocks?
Yes. Write name: block on a line, for example lab: 10.1.0.0/16. The name is used in the answer and in the table.
Does it work for IPv6?
Yes. IPv4 and IPv6 can be mixed in one list. An address is only compared with blocks of its own family, and if you gave no block of that family the page says so instead of reporting an error.
What happens when an address is in no block?
It is listed as not in any block, with the nearest block you gave, so you can see how close it was. That is a normal answer, not an error.
Can I compare two lists of networks?
Yes. Put networks, not single addresses, in the first box. Every pair that shares addresses is listed with the shared range, the number of addresses and a drawing of both blocks.
Use it from AI, the API or the command line
Every LookupOwl tool is also a free API and an MCP tool, with no key and no account. This one is cidr_contains. Please be kind to the rate limits.
curl "https://lookupowl.com/api/v1/tools/cidr-contains?q=203.0.113.77%0A10.1.2.3%0A198.51.100.9%0A2001%3Adb8%3Aabcd%3A%3A1&cidrs=office%3A+203.0.113.0%2F24%0Acorp%3A+10.0.0.0%2F8%0Alab%3A+10.1.0.0%2F16%0Av6%3A+2001%3Adb8%3A%3A%2F32"claude mcp add --transport http lookupowl https://lookupowl.com/mcp