CIDR notation, explained
CIDR (Classless Inter-Domain Routing) describes a network with an IP plus a prefix length: 192.168.1.0/24 means the first 24 bits are the network and the remaining 8 bits are host addresses — 256 total addresses, of which 254 are usable (network + broadcast are reserved).
Cloud providers reserve even more
When you create a VPC subnet in the cloud, the provider takes some addresses for its own infrastructure:
- AWS reserves 5 per subnet: network, gateway, DNS (+2 internal), broadcast.
- Azure reserves 5 per subnet: network, broadcast, DNS, default gateway, and one for future use.
- GCP reserves 4 per subnet: network, first usable, second-to-last, broadcast.
A /24 in AWS therefore has only 251 usable addresses, not 254 — planning around that number prevents the classic "my subnet looks big enough but I can't fit another instance" surprise.
Quick reference
| CIDR | Total IPs | Usable (classic) | AWS usable |
|---|---|---|---|
| /24 | 256 | 254 | 251 |
| /23 | 512 | 510 | 507 |
| /22 | 1024 | 1022 | 1019 |
| /20 | 4096 | 4094 | 4091 |
| /16 | 65536 | 65534 | 65531 |
What happens in the page
Every value is converted to a 32-bit integer first: ip2int() shifts the four octets into place, the subnet mask is built from the prefix length, and the network and broadcast addresses fall out of one bitwise AND and one bitwise OR with the inverted mask. int2ip() turns the results back into dotted notation for display. Doing the arithmetic on integers rather than strings is what makes the host range and the wildcard mask exact instead of approximated.
Where it breaks down
IPv4 only. IPv6 needs 128-bit arithmetic and a different display convention, which is a separate tool. The two small prefixes are special and are labelled as such: /31 is a point-to-point link where both addresses are usable, /32 is a single host with no broadcast address — the familiar "subtract two" rule does not apply to either. Private ranges are marked, but no routing or reachability is inferred, because a subnet calculation says nothing about what is actually connected.
Privacy: no data leaves this tab
IP addresses and masks are integers in memory; nothing is resolved, pinged or logged, so the network you are calculating about is never contacted.
Frequently asked questions
Why is the host count wrong for /31?
Because /31 is designed for point-to-point links: both addresses are assignable and there is no broadcast. The minus-two rule only holds for /30 and shorter prefixes.
Does it support IPv6?
No. IPv6 needs 128-bit arithmetic and a different notation; the calculator is deliberately IPv4-only so the numbers stay exact.
Can it tell me if a subnet overlaps another?
Not in this version. Overlap checking needs both ranges entered, which is a different workflow.