# Network Calc CIDR Compare

> Network Calc CIDR Compare is a paid API for AI agents from network-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-30).

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.

## Facts

- Endpoint: GET https://network-calc.x402tookit.com/cidr-compare?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/network-calc-cidr-compare-53f0c66b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_T1hqhdQbWWnCE3_Y4FgUP

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability network-calc-cidr-compare-53f0c66b
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Compare two IPv4 or IPv6 CIDR blocks: equal, contains, contained, adjacent or disjoint, their common supernet, and test an IP.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
       ],
  
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/network-calc-cidr-compare-53f0c66b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from network-calc.x402tookit.com](https://www.zero.xyz/host/network-calc.x402tookit.com/llms.txt)
