Navigation
POST network

cidr_calc

1 credit

Calculate IP range, subnet mask, and host count from a CIDR block

Endpoint

POST /api/v1/tools/network/cidr_calc

Body Parameters

cidr string required

Example

input Request
{
    "cidr": "192.168.1.0/24"
}
output Response
{
    "network": "192.168.1.0/24",
    "broadcast": "192.168.1.255",
    "last_host": "192.168.1.254",
    "first_host": "192.168.1.1",
    "host_count": 254,
    "is_private": true,
    "subnet_mask": "255.255.255.0",
    "prefix_length": 24,
    "total_addresses": 256
}

Response Format

HTTP/1.1 200 OK SUCCESS
{
  "success": true,
  "data": {
    "network": "192.168.1.0/24",
    "broadcast": "192.168.1.255",
    "last_host": "192.168.1.254",
    "first_host": "192.168.1.1",
    "host_count": 254,
    "is_private": true,
    "subnet_mask": "255.255.255.0",
    "prefix_length": 24,
    "total_addresses": 256
},
  "meta": {
    "tool": "cidr_calc",
    "credits_consumed": 1
  }
}
HTTP/1.1 422 Unprocessable Entity ERROR
{
  "success": false,
  "data": null,
  "error": {
    "code": "validation_error",
    "message": "The given data was invalid."
  }
}

Sign in to try this tool directly from the docs.

Code Examples
Request Example
lightbulb Developer Tip

Credits are deducted before execution. If the upstream tool fails, credits are automatically refunded to your account.