IPv4 CIDR Subnet Calculator avatar

IPv4 CIDR Subnet Calculator

Pricing

$1.00 / 1,000 results

Go to Apify Store
IPv4 CIDR Subnet Calculator

IPv4 CIDR Subnet Calculator

Calculate IPv4 CIDR subnet ranges, network and broadcast addresses, subnet masks, usable IP addresses, and host counts for networking, DevOps, infrastructure automation, and firewall configuration.

Pricing

$1.00 / 1,000 results

Rating

0.0

(0)

Developer

Ask4Favour

Ask4Favour

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Categories

Share

This IPv4 CIDR subnet calculator converts CIDR notation into a network address, broadcast address, subnet mask, usable IP range, and host count. Enter an IPv4 address with a prefix, such as 192.168.1.10/24, or calculate multiple subnets in an ordered batch with structured JSON results for scripts and AI agents.

All calculations are deterministic and run inside the Actor without contacting external IP lookup services.

CIDR to IP range, subnet mask, and host count

Convert CIDR to an IP address range

For 192.168.1.10/24, the complete IP range is 192.168.1.0 through 192.168.1.255; the usable host range is 192.168.1.1 through 192.168.1.254. The canonical network CIDR is 192.168.1.0/24, even when the input contains a host address.

Find the subnet mask and usable host count

Use the subnet mask calculator to translate a prefix length into dotted-decimal notation and check subnet capacity:

CIDR prefixSubnet maskTotal addressesUsable hosts
/24255.255.255.0256254
/27255.255.255.2243230
/30255.255.255.25242

These are standard IPv4 host counts; cloud providers may reserve additional addresses.

Subnet planning for DevOps, firewalls, and IP address management

  • Plan AWS VPC, Azure VNet, Google Cloud, Kubernetes, and on-premises subnets.
  • Check whether a subnet has enough usable IP addresses for servers or devices.
  • Convert CIDR notation into IP ranges for firewall rules and access control lists.
  • Validate network and broadcast addresses during infrastructure automation.
  • Add deterministic IPv4 calculations to DevOps workflows, scripts, and AI agents.
  • Process multiple CIDR blocks for IP address management and network audits.

How to calculate an IPv4 subnet

  1. Open the Actor in Apify Console.
  2. Enter an IPv4 address followed by a CIDR prefix, such as 192.168.1.10/24.
  3. Click Start.
  4. Open the run's Dataset to view or download the calculated subnet data.

Provide one of these input fields:

The input form prefills 192.168.1.10/24; clear it when using cidrs for a batch. If both fields are omitted (including input {}), the Actor calculates this example subnet automatically.

FieldTypeDescription
cidrstringOne IPv4 address with a /0–/32 prefix, such as 10.0.0.5/24
cidrsstring arrayMultiple IPv4 CIDRs to calculate as an ordered batch

Single CIDR input

{
"cidr": "192.168.1.10/24"
}

Batch IPv4 subnet calculations

Submit an array to calculate multiple IPv4 subnets in the same order:

{
"cidrs": [
"192.168.1.10/24",
"10.0.0.1/30",
"172.16.5.100/16"
]
}

IPv4 subnet calculator output

Each input CIDR produces one item in the default dataset:

{
"input": "192.168.1.10/24",
"networkAddress": "192.168.1.0",
"broadcastAddress": "192.168.1.255",
"subnetMask": "255.255.255.0",
"firstUsableHost": "192.168.1.1",
"lastUsableHost": "192.168.1.254",
"totalAddresses": 256,
"usableHostCount": 254,
"canonicalNetworkCidr": "192.168.1.0/24"
}
FieldDescription
inputOriginal IPv4 CIDR submitted to the Actor
networkAddressFirst address in the subnet
broadcastAddressLast address in the subnet
subnetMaskDotted-decimal IPv4 subnet mask
firstUsableHostFirst usable host address
lastUsableHostLast usable host address
totalAddressesTotal number of addresses in the CIDR block
usableHostCountNumber of usable host addresses
canonicalNetworkCidrNormalized network address and prefix
errorValidation error code and message for an invalid batch entry
indexZero-based position of an invalid entry in a batch

IPv4 /31 and /32 subnet calculation examples

The Actor accepts IPv4 CIDR notation only; IPv6 is not supported. Prefixes /0 through /30 reserve the network and broadcast addresses, /31 treats both addresses as usable according to RFC 3021, and /32 represents one host address.

InputNetworkBroadcastFirst usableLast usableTotalUsable
10.0.0.0/3110.0.0.010.0.0.110.0.0.010.0.0.122
8.8.8.8/328.8.8.88.8.8.88.8.8.88.8.8.811

Invalid CIDR input and batch errors

IPv6 addresses, missing prefixes, and prefixes outside /0–/32 are unsupported. Apify validates inputs against the input schema before starting a run.

Invalid entries that reach the calculator produce structured error items. In a batch, valid entries are still calculated and retain their input order, but the Actor run finishes with a nonzero status if any entry is invalid.