Subnet and CIDR Calculator avatar

Subnet and CIDR Calculator

Pricing

from $0.01 / 1,000 results

Go to Apify Store
Subnet and CIDR Calculator

Subnet and CIDR Calculator

Calculate subnet masks, CIDR blocks and host ranges offline for IPv4 and IPv6. Get the netmask, wildcard mask, network and broadcast address, first and last usable host, and address counts. Split networks into subnets, list hosts, test if an IP is in range, or turn an IP range into CIDR blocks.

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

Mangudäi

Mangudäi

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Work out subnet masks, host ranges, broadcast addresses and CIDR blocks for IPv4 and IPv6, as a clean table you can export to CSV, JSON or Excel.

Give it a network like 192.168.1.0/24 and it returns the subnet mask, wildcard mask, network and broadcast address, first and last usable host, total and usable address counts, address class, private or global status, and the reverse DNS pointer. It can also split a network into smaller subnets, list every host address, test whether an IP falls inside a network, and turn a start and end IP into the smallest set of CIDR blocks that cover it.

Everything runs offline on the Python standard library. No API key, no third-party service, nothing that can go stale or break.

What it does

Five operations, mixed freely in one run:

info returns full details for a network. Accepts 192.168.1.0/24, 192.168.1.0 255.255.255.0, 192.168.1.5/255.255.255.0 or a bare address. Host bits are tolerated and normalised to the network address.

subnets splits a network into equal blocks at a new prefix length. Give network and newPrefix, for example 10.0.0.0/16 at /20 returns 16 rows.

hosts lists every usable host address in the network, one row each, capped at 5,000 rows.

contains checks whether an address sits inside a network. Give network and ipAddress, and the row carries the network details plus a true or false contains column.

range takes startIp and endIp and returns the minimal set of CIDR blocks covering that range, one row per block. Useful for firewall rules and allowlists.

Input

One field, calculations, an array of objects:

{
"calculations": [
{ "operation": "info", "network": "192.168.1.0/24" },
{ "operation": "info", "network": "2001:db8::/32" },
{ "operation": "subnets", "network": "10.0.0.0/16", "newPrefix": 20 },
{ "operation": "hosts", "network": "192.168.1.0/29" },
{ "operation": "contains", "network": "192.168.1.0/24", "ipAddress": "192.168.1.42" },
{ "operation": "range", "startIp": "192.168.1.10", "endIp": "192.168.1.100" }
]
}

A bad network or a missing field produces an error row instead of stopping the run, so one typo never costs you the rest of the batch.

Output

One row per result with these columns:

input, operation, cidr, version, networkAddress, prefixLength, netmask, wildcardMask, broadcastAddress, firstHost, lastHost, totalAddresses, usableHosts, ipClass, isPrivate, isGlobal, isMulticast, isLoopback, isLinkLocal, isReserved, reversePointer, index, ipAddress, contains, error.

Sample row for 192.168.1.0/24:

cidrnetmaskwildcardMaskbroadcastfirstHostlastHostusableHostsclassprivate
192.168.1.0/24255.255.255.00.0.0.255192.168.1.255192.168.1.1192.168.1.254254Ctrue

IPv6 rows leave broadcastAddress, wildcardMask and ipClass empty, since those concepts do not apply.

Who uses it

Network engineers planning address space. DevOps and cloud teams sizing VPC and subnet CIDRs before a Terraform run. Security teams converting IP ranges into firewall rules. Anyone who needs subnet math in a spreadsheet or piped into another tool through the Apify API.

Notes

/31 networks return both addresses as usable, following RFC 3021. /32 returns the single address. The hosts operation is capped at 5,000 rows and subnets and range at 5,000 blocks, so a /8 split into /24 will stop early rather than run away.

Pricing is pay per event: you pay per result row, nothing else.