IPv4/IPv6 Subnet Calculator
About the subnet calculator
What is CIDR
CIDR writes a network as address plus prefix length: 192.168.1.0/24. Bits after the slash are the network portion; the rest are host bits.
Subnet mask
Mask 255.255.255.0 equals /24: ones in the network part, zeros in the host part. Wildcard mask is the inverse (for ACLs).
Network and Broadcast
Network is the first address of the block. Broadcast is the last (IPv4 only). Hosts usually skip both, except /31 and /32.
/24, /25, /26… address counts
Total IPv4 addresses = 2^(32−prefix). Usable hosts are usually total−2. Do not mix total and usable counts.
/31 and /32
/31 (RFC 3021) is point-to-point with both addresses usable. /32 is a single host. The classic −2 rule does not apply.
IPv6 prefixes
IPv6 has no broadcast and no classic usable−2. /64 is common per segment. We show network, first/last, compressed and expanded forms.
VLSM
Variable Length Subnet Mask: place largest requirements first, then smaller ones, to reduce address waste.
Reference: IPv4 total addresses
| Prefix | Total addresses |
|---|---|
| /24 | 256 |
| /25 | 128 |
| /26 | 64 |
| /27 | 32 |
| /28 | 16 |
| /29 | 8 |
| /30 | 4 |
| /31 | 2 |
| /32 | 1 |
These are total addresses, not usable hosts.
