https://networkcalc.com/api/range/{input}
Converts an IP range to CIDR blocks, or summarizes a list of CIDR blocks. Accepts ranges (`10.0.0.5-10.0.3.200`), CIDR blocks (`10.0.0.0/24`) and single addresses, separated by commas.
curl https://networkcalc.com/api/range/192.168.1.10-192.168.1.20
{
"status": "OK",
"meta": {},
"input": {
"items": 1,
"runs": 1,
"addresses": 11,
"first_address": "192.168.1.10",
"last_address": "192.168.1.20"
},
"exact": {
"count": 4,
"addresses": 11,
"extra_addresses": 0,
"blocks": [
{
"cidr": "192.168.1.10/31",
"network_address": "192.168.1.10",
"last_address": "192.168.1.11",
"addresses": 2,
"subnet_mask": "255.255.255.254",
"wildcard_mask": "0.0.0.1"
},
{
"cidr": "192.168.1.12/30",
"network_address": "192.168.1.12",
"last_address": "192.168.1.15",
"addresses": 4,
"subnet_mask": "255.255.255.252",
"wildcard_mask": "0.0.0.3"
},
{
"cidr": "192.168.1.16/30",
"network_address": "192.168.1.16",
"last_address": "192.168.1.19",
"addresses": 4,
"subnet_mask": "255.255.255.252",
"wildcard_mask": "0.0.0.3"
},
{
"cidr": "192.168.1.20/32",
"network_address": "192.168.1.20",
"last_address": "192.168.1.20",
"addresses": 1,
"subnet_mask": "255.255.255.255",
"wildcard_mask": "0.0.0.0"
}
]
},
"covering": {
"cidr": "192.168.1.0/27",
"network_address": "192.168.1.0",
"last_address": "192.168.1.31",
"addresses": 32,
"subnet_mask": "255.255.255.224",
"wildcard_mask": "0.0.0.31",
"extra_addresses": 21,
"extra_percent": 65.6,
"is_exact": false,
"extra_ranges": [
{
"start": "192.168.1.0",
"end": "192.168.1.9",
"addresses": 10
},
{
"start": "192.168.1.21",
"end": "192.168.1.31",
"addresses": 11
}
],
"extra_ranges_total": 2
},
"map": {
"start": 3232235776,
"size": 32,
"used": [
{
"offset": 10,
"size": 11
}
]
}
}
Parameters
{input}(Required) An IPv4 range as start-end, a CIDR block, a single address, or a comma-separated list of any of these. Up to 1,000 items. Blocks with host bits set are treated as their network block and reported in meta.normalized.
Example: https://networkcalc.com/api/range/192.168.1.10-192.168.1.20
Response Format
Response Codes
200
OK - Success.400
NO_INPUT_SPECIFIED - The {input} parameter was not specified.400
INVALID_INPUT - One or more items are not valid IPv4 addresses, CIDR blocks or ranges. The offending items are listed in invalid.400
TOO_MANY_ITEMS - The request contained more than 1,000 items.400
TOO_MANY_BLOCKS - The exact result would need more than 5,000 CIDR blocks.