{
  "slug": "ip-range-to-cidr",
  "name": "gizza-ai/ip-range-to-cidr",
  "version": "0.1.0",
  "title": "IP Range to CIDR — Convert a Start-End IP Range to CIDR Blocks (IPv4 & IPv6) — gizza.ai",
  "description": "Convert a start-end IP range like 10.0.0.5-10.0.0.20 into the minimal set of CIDR blocks that exactly covers it — IPv4 and IPv6, free and in-browser.",
  "tags": [
    "ip range to cidr",
    "range to cidr",
    "cidr aggregator",
    "ip range aggregation",
    "ip to cidr",
    "subnet from range",
    "cidr calculator",
    "ipv4",
    "ipv6",
    "cidr block list",
    "minimal cidr cover"
  ],
  "category": "network",
  "urls": {
    "page": "https://gizza.ai/tools/ip-range-to-cidr/",
    "markdown": "https://gizza.ai/tools/ip-range-to-cidr/index.md",
    "descriptor": "https://gizza.ai/tools/ip-range-to-cidr/tool.json",
    "deep_link_example": "https://gizza.ai/tools/ip-range-to-cidr/?input=10.0.0.5-10.0.0.20%20%20or%20%202001%3Adb8%3A%3A-2001%3Adb8%3A%3Affff&output=list"
  },
  "cli": "gizza tool ip-range-to-cidr \"10.0.0.5-10.0.0.20  or  2001:db8::-2001:db8::ffff\"",
  "tool": {
    "description": "Convert an arbitrary inclusive 'start-end' IP range into the MINIMAL set of CIDR blocks that exactly covers it (no more, no fewer addresses), for both IPv4 and IPv6. Set 'input' to a range like '192.168.1.0-192.168.1.255', '10.0.0.5-10.0.0.20', '2001:db8::-2001:db8::ffff', or '2001:db8::1-2001:db8::5' (IPv4 ranges also accept a bare final octet on the right, e.g. '192.168.1.10-20'). A single address with no '-' yields a single host route (/32 for IPv4, /128 for IPv6). An aligned range collapses to one CIDR (192.168.1.0-192.168.1.255 -> 192.168.1.0/24); an unaligned range is split into the fewest aligned blocks (10.0.0.5-10.0.0.20 -> 10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/30, 10.0.0.20/32). Set 'output' to 'list' (default, one CIDR per line) or 'count' (just how many CIDR blocks are needed). This is the inverse of expanding a CIDR into addresses.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "input": {
          "description": "The 'start-end' IP range to convert into CIDR blocks. IPv4 like '192.168.1.0-192.168.1.255' or '10.0.0.5-10.0.0.20' (a bare final octet on the right is accepted as shorthand, e.g. '192.168.1.10-20'), or IPv6 like '2001:db8::-2001:db8::ffff' or '2001:db8::1-2001:db8::5'. A single address with no '-' is treated as a one-address range and returns a /32 (IPv4) or /128 (IPv6) host route. Both endpoints must be the same family and start must be <= end.",
          "type": "string"
        },
        "output": {
          "default": "list",
          "description": "What to return. 'list' (default) gives the minimal set of CIDR blocks that exactly covers the range, one per line. 'count' gives just the number of CIDR blocks needed.",
          "enum": [
            "list",
            "count"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}