{"uid":"cap_T1hqhdQbWWnCE3_Y4FgUP","slug":"network-calc-cidr-compare-53f0c66b","name":"Network Calc CIDR Compare","description":"Compare two IPv4 or IPv6 CIDR blocks: equal, contains, contained, adjacent or disjoint, their common supernet, and test an IP.","url":"https://network-calc.x402tookit.com/cidr-compare?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["a","b"],"properties":{"a":{"type":"string","description":"First block, for example 10.0.0.0/16"},"b":{"type":"string","description":"Second block, for example 10.0.5.0/24"},"ip":{"type":"string","description":"Optional address to test against both blocks"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"a":{"type":["null","string"]},"b":{"type":["null","string"]},"asOf":{"type":["null","string"]},"ipInA":{"type":["boolean","null"]},"ipInB":{"type":["boolean","null"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"version":{"type":["null","number"]},"degraded":{"type":["boolean","null"]},"ipTested":{"type":["null","string"]},"overlaps":{"type":["boolean","null"]},"siblings":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"addressesInA":{"type":["null","string"]},"addressesInB":{"type":["null","string"]},"mergedParent":{},"relationship":{"type":["null","string"]},"commonSupernet":{"type":["null","string"]},"overlapAddresses":{"type":["null","string"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XeYUmlR8EeN6juHhSV1eg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two IPv4 or IPv6 CIDR blocks to determine their relationship (equal, contains, contained, adjacent, or disjoint), finds their common supernet, and optionally tests whether a given IP address falls within either block.","exampleAgentPrompt":"Compare the CIDR blocks 10.0.0.0/16 and 10.0.5.0/24 — tell me their relationship (does one contain the other?), what their common supernet is, and whether the IP 10.0.5.42 falls inside either block.","exampleUseCases":[{"title":"Subnet containment check for firewall rules","prompt":"I'm writing firewall rules and need to know if 172.16.0.0/20 contains 172.16.4.0/24 — are they in a parent-child relationship, or are they disjoint? Also show me their common supernet."},{"title":"IP address membership validation","prompt":"Can you tell me if the IP 192.168.10.55 is inside 192.168.10.0/24, and also check whether it's in 192.168.0.0/16 while you're at it? Compare those two blocks too so I understand how they relate."},{"title":"IPv6 prefix overlap audit","prompt":"I need to audit two IPv6 prefixes — 2001:db8::/32 and 2001:db8:1::/48 — to find out if they overlap, which one is broader, and what their common supernet is."}],"resultDescription":"Returns a structured JSON object with: the relationship label (equal/contains/contained/adjacent/disjoint), a human-readable summary and verdict, whether the blocks overlap or are siblings, the common supernet, address counts for each block, overlap address count if applicable, and — if an IP was supplied — boolean flags indicating membership in each block.","failureModes":["Invalid CIDR notation (malformed prefix length or address) returns an error","Missing required query parameters a or b returns a 400-level error","Mixing IPv4 and IPv6 blocks may return an unsupported comparison error","Very large address spaces may trigger degraded mode (degraded: true) with partial results"],"whenToPreferThis":"Use this endpoint when you need a precise, structured comparison between exactly two CIDR blocks — especially when you want the relationship classification, supernet, overlap details, and optional IP membership all in one call. Prefer it over manual subnet math or general-purpose calculators when building automated network validation, firewall rule auditing, or IP allocation logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:35:49.792Z","isFirstParty":false,"canonicalSlug":"network-calc-cidr-compare-53f0c66b"}