IPv4 CIDR and subnet calculation
A longer prefix such as /26 describes a smaller address range than /24. The part that often causes confusion is counting addresses: the size of a block is not always the number of devices it can hold. Start with 192.0.2.70/26 and follow the boundary through the calculation.
/26 fixes the first 26 bits
An IPv4 address has 32 bits. With /26, the first 26 identify the network prefix and the remaining six describe positions inside that block. CIDR allows this boundary to vary instead of relying on the old class A, B and C divisions. A dotted subnet mask writes the prefix bits as ones and the remaining bits as zeros.
Compare familiar prefix lengths
The total is 2 raised to the power of 32 minus the prefix length: 2⁶ = 64 for /26. Reserved addresses have not yet been deducted. RFC 4632 §3.1 describes this notation and block sizing.
| Prefix | Subnet mask | Total addresses |
|---|---|---|
| /24 | 255.255.255.0 | 256 |
| /26 | 255.255.255.192 | 64 |
| /30 | 255.255.255.252 | 4 |
| /31 | 255.255.255.254 | 2 |
| /32 | 255.255.255.255 | 1 |
Find the block containing 192.0.2.70/26
The last octet is divided into blocks of 64: 0–63, 64–127, 128–191 and 192–255. The value 70 belongs to 64–127. A bitwise AND of the address and subnet mask gives the same starting address, 192.0.2.64.
Read the result
The input host is not necessarily the start of its network. The addresses here belong to the RFC 5737 documentation block; they are examples rather than a proposed production allocation.
| Item | Value |
|---|---|
| Input host | 192.0.2.70/26 |
| Network prefix | 192.0.2.64/26 |
| Full range | 192.0.2.64–192.0.2.127 |
| Conventional subnet broadcast | 192.0.2.127 |
| Conventional host candidates | 192.0.2.65–192.0.2.126: 62 addresses |
Why subtracting two is not a universal rule
On a conventional IPv4 subnet, the all-zero host portion identifies the network and the all-one portion is the subnet broadcast address. That leaves 64 − 2 = 62 host candidates in a /26. Applying the same subtraction to every prefix would give misleading answers for /31 and /32.
The /31 and /32 cases
RFC 3021 §2.1–2.2 applies to point-to-point links. It is not a blanket rule for ordinary LANs; both endpoints and the link configuration must support it.
| Prefix | Meaning |
|---|---|
| 192.0.2.10/31 | On an RFC 3021 point-to-point link, .10 and .11 are both endpoint addresses. There is no subnet-directed broadcast |
| 192.0.2.70/32 | Exactly one address; in a routing table this is a host route to that address |
Split a block without gaps or overlaps
To divide 192.0.2.0/24 into four equal parts, extend the prefix by two bits. The four /26 blocks begin at .0, .64, .128 and .192. Each contains 64 addresses, so together they cover the original block exactly.
Block size is not available capacity
A conventional /24 has 254 host candidates, while four conventional /26 subnets have 62 × 4 = 248. Each subnet needs its own reserved addresses. Gateways, fixed assignments and cloud-provider reservations can reduce the number available to devices further. Arithmetic alone cannot show which addresses are free or whether a host is reachable.
Compare boundaries in the calculator
Enter 192.0.2.70/26 in the Online Tools subnet calculator, then try /25 and /27. Compare the mask, network, range and host count. The calculation runs in your browser; it does not test a connection to the entered address.
Interpret /31 output in context
The calculator counts two addresses for /31 and one for /32. Its broadcast field also shows the calculated final address. On an RFC 3021 link, that final address is an endpoint, not a subnet broadcast destination.
Specifications and further reading
RFC 4632 §3.1: CIDR notation; RFC 3021 §2: /31 links; RFC 1122 §3.2.1.3: special IPv4 addresses, with the /31 updates in RFC 3021. Continue with DNS basics for name resolution, or IP address location for the limits of geographic estimates.