How to use this tool
- Enter ipv4 address, cidr prefix length.
- Select Update result to view the result.
- Check the method and assumptions below before using the result.
Input reference and sample values
Use the units and choices shown for each field. Sample values are provided for practice, not as recommendations.
| Input | Format and units | Sample |
|---|---|---|
| IPv4 address | Enter text using the format shown in the sample. | 192.168.1.42 |
| CIDR prefix length | Whole numbers only. Zero or positive. Maximum: 32. | 24 |
Result for these sample inputs
192.168.1.0/24
- Subnet mask
- 255.255.255.0
- Last address
- 192.168.1.255
- Address count
- 256
- Usable host range
- 192.168.1.1 – 192.168.1.254
- Usable host count
- 254
The first and last addresses are excluded from the conventional host range.
Select Try the example in the form to load these values and calculate them again. This replaces the current form inputs. Compare the result with the method and worked explanation below.
The method, explained
Convert the IPv4 address to a 32-bit integer and apply the prefix mask using bitwise AND. The block contains 2^(32 − prefix) addresses. Conventional subnets reserve the first and last addresses; /31 point-to-point and /32 host routes are handled separately.
Using ipv4 address = 192.168.1.42, cidr prefix length = 24, the result is 192.168.1.0/24. Change these example inputs to match your task; use the method above to check each step.
What to keep in mind
IPv4 only. This arithmetic does not determine address ownership, routing, public reachability or whether every address in the range may be assigned.
Reference: RFC 3021: 31-bit IPv4 point-to-point prefixes
Methodology maintained by ClarityKit. How these tools are built and checked.