A little context. A clearer answer.
When this calculator is useful
Changing the prefix moves the network boundary and can put the same address in a block with a different host range. For a related calculation, try Download and upload time calculator.
What to enter
| Input | What it means | Example value |
|---|---|---|
| Octet 1 | Octet 1: 0–255. | 192 |
| Octet 2 | Octet 2: 0–255. | 168 |
| Octet 3 | Octet 3: 0–255. | 1 |
| Octet 4 | Octet 4: 0–255. | 42 |
| CIDR prefix length | CIDR prefix length: 0–32. /31 assumes an RFC 3021 point-to-point link: both addresses identify endpoints, with no directed broadcast. /32 identifies a single host address; it has no directed broadcast. | 24 |
How the calculation works
- Octet 1–4: 0–255.
- CIDR prefix length: /0–/32.
- Network address; Subnet mask; Host address range.
A = a×2²⁴ + b×2¹⁶ + c×2⁸ + d; B = 2^(32−p); network = floor(A/B)×B; mask = 2³²−B; hosts = p<31 ? B−2 : BA worked example
Change “CIDR prefix length” from 24 to 26 and keep the other inputs from the worked example. The value for “Theoretical usable host addresses” goes from 254 to 62.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
Address arithmetic only: reserved ranges, public routability and provider restrictions are not checked. For /0–/30, the conventional host count excludes network and broadcast addresses. /31 assumes an RFC 3021 point-to-point link: both addresses identify endpoints, with no directed broadcast. /32 identifies a single host address; it has no directed broadcast.
Frequently asked questions
How is the result calculated?
Total addresses = 2^(32−p); p = CIDR prefix length. Theoretical usable host addresses: /0–/30 = 2^(32−p)−2; /31 = 2; /32 = 1.
Which units are used?
Octet: 8 bit, 0–255. CIDR prefix length: 0–32 bit. IPv4: 32 bit.
What assumptions apply?
Address arithmetic only: reserved ranges, public routability and provider restrictions are not checked. For /0–/30, the conventional host count excludes network and broadcast addresses. /31 assumes an RFC 3021 point-to-point link: both addresses identify endpoints, with no directed broadcast. /32 identifies a single host address; it has no directed broadcast.