CIDR IP Range Calculator avatar

CIDR IP Range Calculator

Pricing

Pay per event

Go to Apify Store
CIDR IP Range Calculator

CIDR IP Range Calculator

Calculate network address, broadcast, first/last usable IP, total hosts, subnet mask, wildcard mask, and binary representation from CIDR notation. Supports IPv4 and IPv6. Pure math — no proxy.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Categories

Share

Calculate network addresses, broadcast IPs, usable host ranges, subnet masks, wildcard masks, and binary representations from CIDR notation in bulk. Supports both IPv4 and IPv6. Pure math — no proxy required, results are instant.

Try it at apify.com/automation-lab/cidr-ip-range-calculator.

What does CIDR IP Range Calculator do?

The CIDR IP Range Calculator takes one or more CIDR blocks (e.g., 192.168.1.0/24, 10.0.0.0/8) and returns a complete network breakdown for each one. For every CIDR block you provide, the actor calculates:

  • Network address and broadcast address
  • First and last usable IP addresses
  • Total hosts and usable host count
  • Subnet mask and wildcard mask
  • IP class (A, B, C, D multicast, E reserved)
  • Private/public, loopback, link-local, multicast flags
  • Binary representation of IP and subnet mask (dot-notation)
  • Subnet breakdown — split any block into two equal subnets one prefix smaller

It works for both IPv4 (prefix /0 to /32) and IPv6 (prefix /0 to /128), including special cases like /31 (point-to-point RFC 3021) and /32 (host routes).

Who is CIDR IP Range Calculator for?

🖧 Network engineers and sysadmins

You need to design IP addressing schemes quickly and accurately. Use this actor to bulk-validate CIDR ranges before deploying VPCs, firewall rules, or BGP announcements — without opening Excel or memorizing subnet math.

  • Plan multiple subnets in one API call
  • Verify broadcast addresses and usable ranges before provisioning
  • Document network layouts with auto-generated subnet breakdowns

☁️ Cloud infrastructure and DevOps teams

AWS, GCP, and Azure all use CIDR notation for VPC subnets, security groups, and routing tables. This actor speeds up your IaC planning:

  • Validate CIDR blocks before feeding them into Terraform or CloudFormation templates
  • Check whether ranges overlap by comparing network/broadcast addresses
  • Generate documentation for network topology reviews

🔐 Security analysts and penetration testers

When scoping engagements or writing firewall rules, you need precise IP range boundaries:

  • Confirm exact host counts and boundaries for scan scopes
  • Verify wildcard masks for ACLs and firewall rules
  • Check whether given IPs fall in private, link-local, or loopback ranges

👩‍💻 Developers and students learning networking

Understand subnetting visually with binary representations:

  • See how subnet masks divide the address space in binary dot-notation
  • Batch-calculate multiple examples to practice CIDR subnetting
  • Integrate into learning tools or networking curriculum apps

🤖 Automation and data pipeline builders

Use the Apify API or MCP to integrate CIDR calculations into your workflows:

  • Enrich IP address datasets with network context
  • Validate CIDR inputs in web forms or configuration validators
  • Feed results into monitoring dashboards or IP management (IPAM) systems

Why use CIDR IP Range Calculator?

  • No proxy, no scraping — pure math, instant results, zero blocked requests
  • Bulk processing — calculate dozens of CIDR blocks in a single run
  • IPv4 and IPv6 — full support for both address families, including special cases
  • Binary representations — see the subnet mask and network address in binary dot-notation
  • Subnet splitting — auto-generate one-level subnet breakdowns
  • API-ready output — structured JSON you can pipe directly into other tools
  • Edge cases handled — /31 (point-to-point), /32 (host), /0 (default route), invalid inputs return clear error messages
  • No API key, no account — runs on Apify with pay-per-event pricing, $5 free credit included

What data can you extract?

Each CIDR block returns a structured JSON object with the following fields:

FieldTypeDescription
cidrstringNormalized CIDR notation (network address + prefix)
ipVersionstring"IPv4" or "IPv6"
isValidbooleanWhether the CIDR block was valid and parseable
networkAddressstringNetwork address of the block
broadcastAddressstringBroadcast address (last IP in block)
firstUsableIpstringFirst host-assignable IP address
lastUsableIpstringLast host-assignable IP address
totalHostsnumber/stringTotal number of IP addresses in the block
usableHostsnumber/stringHost-assignable IPs (totalHosts minus network and broadcast)
subnetMaskstringDotted-decimal subnet mask (IPv4) or IPv6 equivalent
wildcardMaskstringInverse of subnet mask, used in ACLs and Cisco config
prefixLengthnumberCIDR prefix (e.g., 24 for /24)
ipClassstringClass A/B/C/D/E for IPv4; "IPv6 (classless)" for IPv6
isPrivatebooleanTrue if the range is RFC 1918 (IPv4) or RFC 4193 (IPv6) private space
isLoopbackbooleanTrue if loopback range (127.0.0.0/8 or ::1/128)
isLinkLocalbooleanTrue if link-local range (169.254.0.0/16 or fe80::/10)
isMulticastbooleanTrue if multicast range (224.0.0.0/4 or ff00::/8)
ipBinarystringBinary dot-notation of the network address (optional)
subnetMaskBinarystringBinary dot-notation of the subnet mask (optional)
subnetsarrayTwo equal child subnets one prefix smaller (optional)
errorstringError message if CIDR was invalid, null otherwise

How much does it cost to calculate CIDR ranges?

This actor uses pay-per-event pricing — you pay only for what you calculate. No monthly subscription. All platform costs are included.

FreeStarter ($29/mo)Scale ($199/mo)Business ($999/mo)
Per CIDR block$0.00115$0.001$0.00078$0.0006
1,000 blocks$1.15$1.00$0.78$0.60

Plus a one-time start fee of $0.005 per run.

Higher-tier plans get additional volume discounts (Platinum and Diamond tiers available for enterprise).

Real-world cost examples:

InputResultsDurationCost (Free tier)
3 CIDR blocks (default input)3~1s~$0.008
50 CIDR blocks50~2s~$0.063
500 CIDR blocks500~5s~$0.580

On the free plan ($5 credit): You can calculate ~4,300 CIDR blocks before spending your credits.

How to calculate CIDR IP ranges

  1. Go to apify.com/automation-lab/cidr-ip-range-calculator
  2. Click Try for free — no credit card required, $5 free credits included
  3. Enter your CIDR blocks in the CIDR Blocks input field (one per line)
  4. Optionally enable subnet breakdown or toggle binary representation
  5. Click Start and wait ~1-5 seconds for results
  6. Download results as JSON, CSV, or Excel from the Results tab

You can also trigger runs via the Apify API or MCP (see sections below).

Input examples:

Standard /24 with binary:

{
"cidrs": ["192.168.1.0/24"],
"includeBinaryRepresentation": true
}

Multiple blocks with subnet split:

{
"cidrs": ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"],
"includeSubnets": true,
"includeBinaryRepresentation": false
}

Mixed IPv4 and IPv6:

{
"cidrs": ["192.168.1.0/24", "2001:db8::/32", "fe80::/10", "::1/128"],
"includeBinaryRepresentation": true
}

Input parameters

ParameterTypeRequiredDefaultDescription
cidrsarray of strings✅ YesCIDR blocks to calculate. IPv4: "192.168.1.0/24". IPv6: "2001:db8::/32". Duplicates are removed automatically.
includeSubnetsbooleanNofalseWhen true, outputs a two-entry subnet breakdown — splits the block into two equal child subnets one prefix length smaller.
includeBinaryRepresentationbooleanNotrueWhen true, includes binary dot-notation of the network address and subnet mask. Useful for learning or documentation.

Output examples

IPv4 /24 block:

{
"cidr": "192.168.1.0/24",
"ipVersion": "IPv4",
"isValid": true,
"networkAddress": "192.168.1.0",
"broadcastAddress": "192.168.1.255",
"firstUsableIp": "192.168.1.1",
"lastUsableIp": "192.168.1.254",
"totalHosts": 256,
"usableHosts": 254,
"prefixLength": 24,
"subnetMask": "255.255.255.0",
"wildcardMask": "0.0.0.255",
"ipClass": "C",
"isPrivate": true,
"isLoopback": false,
"isLinkLocal": false,
"isMulticast": false,
"ipBinary": "11000000.10101000.00000001.00000000",
"subnetMaskBinary": "11111111.11111111.11111111.00000000",
"subnets": null,
"error": null
}

IPv6 /32 block:

{
"cidr": "2001:db8::/32",
"ipVersion": "IPv6",
"isValid": true,
"networkAddress": "2001:db8::",
"broadcastAddress": "2001:db8:ffff:ffff:ffff:ffff:ffff:ffff",
"firstUsableIp": "2001:db8::1",
"lastUsableIp": "2001:db8:ffff:ffff:ffff:ffff:ffff:fffe",
"totalHosts": "2^96",
"usableHosts": "2^96 - 2",
"prefixLength": 32,
"subnetMask": "ffff:ffff::",
"wildcardMask": "::ffff:ffff:ffff:ffff:ffff:ffff",
"ipClass": "IPv6 (classless)",
"isPrivate": false,
"isLoopback": false,
"isLinkLocal": false,
"isMulticast": false,
"error": null
}

Invalid CIDR block:

{
"cidr": "256.256.256.256/24",
"ipVersion": null,
"isValid": false,
"networkAddress": null,
"error": "Error: Invalid IPv4 octet: 256"
}

Tips for best results

  • 🔢 Batch your requests — pass all CIDR blocks in a single run. The actor processes them sequentially in under 1ms each, so 500 blocks takes ~2 seconds total.
  • 🌐 Mixed IPv4 and IPv6 in one run — the actor auto-detects IP version per block. You can mix both families in one cidrs array.
  • 📊 Export to CSV for Excel — use the Results tab to download as CSV and open directly in Excel or Google Sheets. Each field becomes a column.
  • ⚠️ Invalid CIDRs don't stop processing — if one block is invalid, it's recorded with isValid: false and an error message, but the rest of the run continues.
  • 🔗 Host routes (/32 for IPv4, /128 for IPv6) return the host IP as both firstUsableIp and lastUsableIp.
  • 🔗 Point-to-point links (/31 IPv4, /127 IPv6) follow RFC 3021 / RFC 6164 — both addresses are listed as usable.
  • 💰 Keep start fees low — for cost-sensitive automations, batch all CIDR blocks in one run rather than making separate runs, since each run has a $0.005 start fee.

Integrations

CIDR Calculator → Google Sheets (network documentation)

Run the actor on your VPC CIDR blocks, download results as CSV, and import into Google Sheets. Use it as a live IP addressing table for infrastructure documentation. Schedule weekly runs to catch any new allocations.

CIDR Calculator → Terraform / CloudFormation validation

Pipe the actor's JSON output into a validation script before terraform apply. Verify that:

  • No two subnets overlap (compare network/broadcast ranges)
  • All blocks are in private RFC 1918 space (isPrivate: true)
  • Host counts match your capacity planning

CIDR Calculator → Zapier / Make workflow

Trigger on a new row in a Google Sheet containing CIDR blocks, run the actor via the Apify API, and write results back to the sheet. Automates documentation for network change management tickets.

CIDR Calculator → Security audit pipeline

Feed the actor a list of customer-submitted CIDR scopes, flag any that are public (not isPrivate), loopback, or multicast, and alert via Slack before an engagement begins.

Scheduled subnet planning runs

Use Apify's cron scheduler to run the actor nightly against your IP address management (IPAM) export. Compare results to detect unauthorized subnet changes or allocations.

Using the Apify API

Run the actor programmatically from any language using the Apify API.

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('automation-lab/cidr-ip-range-calculator').call({
cidrs: ['192.168.1.0/24', '10.0.0.0/8', '2001:db8::/32'],
includeSubnets: true,
includeBinaryRepresentation: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python

from apify_client import ApifyClient
client = ApifyClient(token='YOUR_APIFY_TOKEN')
run = client.actor('automation-lab/cidr-ip-range-calculator').call(run_input={
'cidrs': ['192.168.1.0/24', '10.0.0.0/8', '2001:db8::/32'],
'includeSubnets': True,
'includeBinaryRepresentation': True,
})
for item in client.dataset(run['defaultDatasetId']).iterate_items():
print(item['networkAddress'], '-', item['broadcastAddress'])

cURL

# Start the run
curl -X POST "https://api.apify.com/v2/acts/automation-lab~cidr-ip-range-calculator/runs?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cidrs": ["192.168.1.0/24", "10.0.0.0/8"],
"includeBinaryRepresentation": true
}'
# Get results (replace RUN_ID and DATASET_ID from the response above)
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?token=YOUR_APIFY_TOKEN&format=json"

Use with AI agents via MCP

CIDR IP Range Calculator is available as a tool for AI assistants that support the Model Context Protocol (MCP).

Add the Apify MCP server to your AI client — this gives you access to all Apify actors, including this one:

Setup for Claude Code

$claude mcp add --transport http apify "https://mcp.apify.com"

Setup for Claude Desktop, Cursor, or VS Code

Add this to your MCP config file:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com"
}
}
}

Your AI assistant will use OAuth to authenticate with your Apify account on first use.

Example prompts

Once connected, try asking your AI assistant:

  • "Use automation-lab/cidr-ip-range-calculator to calculate the network details for 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 — I want broadcast addresses and usable host counts"
  • "Calculate the CIDR breakdown for our VPC subnets: 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24 — include subnet splits so I can see /25 subnets"
  • "Check if 2001:db8::/32, fe80::/10, and ::1/128 are private, loopback, or link-local ranges"

Learn more in the Apify MCP documentation.

Yes. This actor performs pure mathematical calculations on IP addresses and CIDR notation. It does not scrape any website, make network requests to third parties, or access any external data source. It processes only the input you provide.

No website terms of service apply. No robots.txt is relevant. No personal data is collected or processed — IP network addresses are infrastructure identifiers, not personal information under GDPR or CCPA.

FAQ

How fast is the actor? Each CIDR calculation takes under 1ms of compute. A batch of 100 CIDR blocks completes in under 2 seconds total, including actor startup. The actor is designed for bulk processing — send as many blocks as you need in one run.

How much does it cost to calculate 1,000 CIDR blocks? On the free plan: 1,000 × $0.00115 + $0.005 start = ~$1.155. On Starter ($29/mo): ~$1.005. You get $5 free credits on signup, which covers ~4,300 CIDR blocks at free tier prices.

Can I use this offline or as a library instead? The Apify actor version gives you API access, scheduling, export formats, and MCP integration. If you need an offline tool, there are npm packages like ip-cidr and netmask for Node.js. The actor is built on pure JS math — no third-party network packages used.

Why does a /31 block show 2 usable hosts instead of 0? /31 blocks follow RFC 3021, which allows point-to-point links to use both addresses (no network/broadcast reservation). Similarly, /127 IPv6 follows RFC 6164. If you need the traditional calculation (usable = 0 for /31), filter on prefixLength < 31 in your results.

Why does totalHosts show "2^96" for some IPv6 blocks? JavaScript's number type loses precision above 2^53. For very large IPv6 blocks (prefix /75 and smaller), the total host count exceeds safe integer range and is returned as a string like "2^96" to preserve accuracy. Use BigInt in your application if you need arithmetic on these values.

Why are some fields null? Invalid CIDR blocks (bad syntax, out-of-range octets, missing prefix) return isValid: false with all calculated fields as null and a descriptive error message. Valid blocks never return null for core fields.

The binary representation looks odd for IPv6 — is that correct? IPv6 binary is returned as 128-bit binary grouped into 16-bit chunks separated by dots (e.g., 0010000000000001.0000110110111000...). This is non-standard notation for visual inspection — standard IPv6 binary has no separators. The grouping makes it easier to see which bits belong to the network vs host portion.

Other network and IP tools

Explore more automation-lab network utilities: