IPv4 CIDR ⇄ subnet mask ⇄ network, broadcast, host range — computed in your browser
Accepts CIDR (192.168.10.0/26), dotted mask (192.168.10.0/255.255.255.192), or a host address with either (192.168.10.35/26 → its network is computed). Prefix /0 to /32.
| CIDR | Subnet Mask | Wildcard | Total Addresses | Usable Hosts |
|---|---|---|---|---|
/8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
/9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
/10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
/11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
/12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
/13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
/14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
/15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
/16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
/17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
/18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
/19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
/20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
/21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
/22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
/23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
/24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
/25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
/26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
/27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
/28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
/29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
/30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
/31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 (RFC 3021) |
/32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Usable hosts = total − 2 (network + broadcast) for /0 through /30. A /31 keeps both addresses usable for point-to-point links under RFC 3021, and a /32 is a single host route.
| Block | Range | Usable Hosts | Defined By / Use |
|---|---|---|---|
10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 | 16,777,214 | RFC 1918 — private LANs |
172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 | 1,048,574 | RFC 1918 — private LANs |
192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 | 65,534 | RFC 1918 — home routers |
127.0.0.0/8 | 127.0.0.0 – 127.255.255.255 | — | RFC 1122 — loopback |
169.254.0.0/16 | 169.254.0.0 – 169.254.255.255 | — | RFC 3927 — link-local (DHCP failure) |
100.64.0.0/10 | 100.64.0.0 – 100.127.255.255 | — | RFC 6598 — carrier-grade NAT |
224.0.0.0/4 | 224.0.0.0 – 239.255.255.255 | — | RFC 1112 — multicast |
An IPv4 address is 32 bits, split between network bits and host bits. The subnet mask is a wall of 1s (network part) followed by 0s (host part), and CIDR notation just counts the 1s: /26 means 26 network bits, 6 host bits. Three AND operations against the mask give you everything:
Host count follows from the 6 remaining bits: 26 = 64 total addresses, minus the two reserved ones = 62 hosts. The wildcard mask is the inverse of the subnet mask (0.0.0.63 for a /26) — that's what ACLs in Cisco-style syntax match against.
Take 172.16.5.9/12. The mask is 255.240.0.0, so only the top 4 bits of the second octet belong to the network: 16 AND 240 = 16, but addresses from 172.16.0.0 through 172.31.255.255 all share the same 12 network bits. The calculator returns network 172.16.5.9 → 172.16.0.0, broadcast 172.31.255.255, usable 172.16.0.1 – 172.31.255.254 — 1,048,576 total addresses, 1,048,574 usable. This is the classic RFC 1918 range people mis-size by treating it as a /16.
Divide 192.168.10.0/24 into 4 equal subnets and each gets 2 more host bits sacrificed: four /26s of 64 addresses. The split table above lists them — .0/26, .64/26, .128/26, .192/26 — each with 62 usable hosts, 248 usable addresses across the whole /24 (4 × 62). Planning rule of thumb: size subnets to your host count plus ~20% headroom, not to round numbers — the wastage between a /27 (30 hosts) and a /26 (62) adds up fast across a large campus.
Need room for 300 hosts? Solve 2n − 2 ≥ 300: n = 9 gives 510 usable (29 = 512, minus 2). So the prefix is 32 − 9 = /23, mask 255.255.254.0. The "need usable hosts" box in the calculator does this math for any count up to 16,777,214.
A /26 has 26 mask bits, so 32 − 26 = 6 host bits and 26 = 64 total addresses. The network address and broadcast address are reserved, leaving 62 usable hosts spanning x.x.x.1 through x.x.x.62 in a 255.255.255.192 block. For example, 192.168.10.0/26 runs from 192.168.10.1 to 192.168.10.62, with 192.168.10.63 as broadcast.
The CIDR number counts the leading 1-bits in the 32-bit mask. Write that many 1s, pad the rest with 0s, and read each octet. /26 is 26 ones followed by 6 zeros: 11111111.11111111.11111111.11000000, which is 255.255.255.192. The wildcard (inverse) mask is the complement: 0.0.0.63.
Four. A /24 has 256 addresses and a /26 has 64, and 256 / 64 = 4. The four subnets are 192.168.10.0/26, 192.168.10.64/26, 192.168.10.128/26, and 192.168.10.192/26, each holding 62 usable hosts — 248 usable addresses across the four combined.
A /12 mask is 255.240.0.0 — the second octet is masked to its top 4 bits. ANDing the address 172.16.5.9 with mask 255.240.0.0 gives network 172.16.0.0 because the entire 172.16.0.0/12 private block (RFC 1918) spans 172.16.0.0 through 172.31.255.255: 1,048,576 addresses total, 1,048,574 usable. Any address in that range lands in the same network.
It is the last address in a subnet, with every host bit set to 1 (192.168.10.63 for 192.168.10.0/26). Traffic sent to it reaches all hosts on that subnet, which is how ARP requests and DHCP discovery broadcasts work on IPv4 networks. It cannot be assigned to a device, which is one of the two reserved addresses per subnet.
A /23. You need at least 302 addresses (300 hosts plus network and broadcast), and 2(32−23) = 512 total addresses, leaving 510 usable. A /24's 254 usable hosts would be too small. The rule: find the smallest n where 2n − 2 is at least your host count, then the prefix is 32 − n.