# Calculate a private IPv4 subnet range

**Use case:** 

Calculate the network address, broadcast address, subnet mask, usable host range, and capacity for a private IPv4 CIDR block; this ready-to-run /24 example demonstrates subnet planning for networks, firewalls, and infrastructure automation.

## Input

```json
{
  "cidr": "192.168.1.10/24",
  "cidrs": [
    "192.168.1.10/24",
    "10.0.0.1/30"
  ]
}
```

## Output

```json
{
  "input": {
    "label": "Input CIDR",
    "format": "string"
  },
  "canonicalNetworkCidr": {
    "label": "Canonical network CIDR",
    "format": "string"
  },
  "networkAddress": {
    "label": "Network address",
    "format": "string"
  },
  "broadcastAddress": {
    "label": "Broadcast address",
    "format": "string"
  },
  "subnetMask": {
    "label": "Subnet mask",
    "format": "string"
  },
  "firstUsableHost": {
    "label": "First usable host",
    "format": "string"
  },
  "lastUsableHost": {
    "label": "Last usable host",
    "format": "string"
  },
  "totalAddresses": {
    "label": "Total addresses",
    "format": "integer"
  },
  "usableHostCount": {
    "label": "Usable hosts",
    "format": "integer"
  },
  "error": {
    "label": "Validation error",
    "format": "object"
  },
  "index": {
    "label": "Input index",
    "format": "integer"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The IPv4 CIDR Subnet Calculator Actor is ready to run with the inputs already set for "Calculate a private IPv4 subnet range". [Sign up or log in](https://console.apify.com/create-task-from-example/YBMQ8FNSynV0GzWap) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Calculate a private IPv4 subnet range" task

The IPv4 CIDR Subnet Calculator Actor will start running based on the input automatically. You can also change all the input fields, like IPv4 CIDR and IPv4 CIDRs, to match your specific use case.

### 3. Receive the "Calculate a private IPv4 subnet range" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as input cidr, canonical network cidr, network address, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Calculate a private IPv4 subnet range" task via API](https://apify.com/ask4favour/ipv4-cidr-subnet-calculator.md).

## FAQ

### What does this IPv4 subnet task return?

The private IPv4 subnet task returns the network and broadcast addresses, subnet mask, usable host range, total addresses, usable host count, and canonical CIDR.

### What input does this subnet task need?

The private IPv4 subnet task needs one IPv4 address with a /0 through /32 CIDR prefix, such as 192.168.1.10/24.

### Does this task call an external IP service?

The private IPv4 subnet task performs deterministic calculations inside the Actor and makes no external IP lookup requests.

## About this Actor

This example demonstrates how to use [IPv4 CIDR Subnet Calculator](https://apify.com/ask4favour/ipv4-cidr-subnet-calculator.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/ask4favour/ipv4-cidr-subnet-calculator.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/ask4favour/ipv4-cidr-subnet-calculator.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
