The one idea behind subnetting
An IPv4 address is 32 bits. A subnet mask says which leading bits are the network and which trailing bits are hosts. CIDR notation /26 means the first 26 bits are network; the remaining 6 bits identify hosts — so the network contains 26 = 64 addresses, of which 62 are usable (network and broadcast addresses are reserved).
The math you'll actually use
usable hosts = 2^(32 - prefix) - 2
block size = 256 - mask-octet
For a /26: mask is 255.255.255.192, block size is 256−192 = 64, so subnets start at .0, .64, .128, .192 within the fourth octet. The network address is the first, broadcast the last, gateway conventionally the first usable.
Common CIDR table
| CIDR | Mask | Usable hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /30 | 255.255.255.252 | 2 (point-to-point) |
A worked example
Split 10.0.4.0/24 into four equal subnets. Four subnets need 2 bits → borrow 2 host bits → /26 each:
- 10.0.4.0/26 — hosts .1–.62, broadcast .63
- 10.0.4.64/26 — hosts .65–.126, broadcast .127
- 10.0.4.128/26 — hosts .129–.190, broadcast .191
- 10.0.4.192/26 — hosts .193–.254, broadcast .255
Pitfalls
- "Which subnet does 10.0.4.100/26 belong to?" — the answer is 10.0.4.64/26, found by masking (100 AND 192 = 64). Address ≠ network address; always derive the network.
- Size for growth: a /27 (30 hosts) is full at 25 devices once you reserve gateway and a couple of infrastructure addresses.
- Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — cloud VPCs default inside these; overlapping ranges break VPN routing later.
Run these calculations instantly — mask, wildcard, ranges, host counts, split planning — in the IPv4 Subnet Calculator.