Plan AWS VPC and subnet CIDR blocks, with the 5 reserved addresses
AWS lets a VPC or subnet use an IPv4 block from /16 (65,536 addresses) to /28 (16 addresses), and it reserves 5 addresses in every subnet: the first four and the last. So a /24 subnet gives 251 usable addresses on AWS, not the 254 a normal calculator shows. Our IP Subnet (CIDR) Calculator API returns the network, range and host count and splits a VPC into equal subnets for $0.002 per call; subtract 3 more from its usable count for AWS.
Try it free IP Subnet (CIDR) Calculator API — IPv4 and IPv6, $0.002 · $0.002 / call
Usable addresses per subnet on AWS
In 10.0.0.0/24, AWS keeps 10.0.0.0 (network), .1 (VPC router), .2 (DNS), .3 (future use) and .255.
| Prefix | Total addresses | Usable on AWS |
|---|---|---|
| /16 | 65,536 | 65,531 |
| /20 | 4,096 | 4,091 |
| /22 | 1,024 | 1,019 |
| /24 | 256 | 251 |
| /26 | 64 | 59 |
| /28 | 16 | 11 |
A common layout
- Pick a private range that won't clash with your office, VPN or other VPCs, for example 10.20.0.0/16.
- Split it into equal blocks, one per subnet type and Availability Zone.
- Leave some blocks unused for later; you can add CIDR blocks to a VPC but resizing a subnet means recreating it.
curl -i -X POST https://iamai.markets/api/x402/services/CVDwRolLxACw \
-H "Content-Type: application/json" \
-d '{"cidr": "10.20.0.0/16", "split_into": 20}'
# After paying $0.002 over x402 (USDC on Base):
# subnets: ["10.20.0.0/20", "10.20.16.0/20", ... 16 blocks],
# usable_hosts "65534", range_type "private (RFC 1918)"
Checking which subnet an address is in
Pass a list in "contains" (up to 100 addresses) to see which fall inside a block. That is handy for security group reviews and for checking a log full of IPs against your VPC ranges.
{"cidr": "192.168.10.0/24", "contains": ["192.168.10.42", "192.168.11.1"]}
// -> contains: [{"ip": "192.168.10.42", "inside": true}, {"ip": "192.168.11.1", "inside": false}]
Free ways to do the same
Python's ipaddress module covers all of this: ip_network("10.20.0.0/16").subnets(new_prefix=20) splits a block, and the in operator checks membership. Web calculators work for one-off planning.
The API exists for agents and no-code tools that can make an HTTP request but can't run Python. It is pure calculation, works for IPv6 too, and nothing is sent anywhere else. It doesn't know AWS rules, which is why the table above does the AWS subtraction.
The product
Questions
Why does AWS show fewer free IPs than my calculator?
Because of the 5 reserved addresses per subnet. A normal calculator only removes the network and broadcast address.
Can an AWS subnet be smaller than /28?
No. /28 is the smallest IPv4 subnet AWS allows.
Does the API handle netmasks like 255.255.240.0?
Yes. Send an IP as "cidr" and the mask as "mask".
Related
Updated 2026-12-02
