Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Subnet Calculator API

Network, broadcast, mask, host range and host count for an IPv4 CIDR.

POST /api/v1/tools/subnet-calculatorMCP subnet_calculatorNetwork Tools

Calculate an IPv4 subnet from CIDR or a netmask: network, broadcast, host range, wildcard, binary and address type. Split networks into smaller subnets.

Input

Send these as a JSON object. Unknown fields are rejected.

cidr
An IPv4 address with prefix, e.g. 192.168.1.10/24. (string, required)
curl https://pithlab.com/api/v1/tools/subnet-calculator \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"cidr":"10.0.5.70/26"}'
Example response
{
  "ok": true,
  "result": {
    "address": "10.0.5.70",
    "prefix": 26,
    "cidr": "10.0.5.64/26",
    "network": "10.0.5.64",
    "broadcast": "10.0.5.127",
    "firstHost": "10.0.5.65",
    "lastHost": "10.0.5.126",
    "totalAddresses": 64,
    "usableHosts": 62,
    "netmask": "255.255.255.192",
    "wildcard": "0.0.0.63",
    "ipClass": "A",
    "classification": {
      "scope": "private",
      "label": "Private network (RFC 1918)",
      "range": "10.0.0.0/8"
    },
    "hex": "0x0a000546",
    "integer": 167773510,
    "note": ""
  }
}