Calculated Network Results
Results appear here after you submit the calculator form.
IP Prefix Length Calculator
Enter an IPv4 address with either a prefix length or subnet mask. The calculator returns mask conversions, ranges, counts, and subnet details.
Plotly Graph
The chart updates after calculation. It helps compare network bits, host bits, total addresses, usable hosts, and reserved addresses.
Example Data Table
| IP Address | Prefix | Subnet Mask | Network Address | Broadcast Address | Usable Hosts |
|---|---|---|---|---|---|
| 192.168.10.34 | /24 | 255.255.255.0 | 192.168.10.0 | 192.168.10.255 | 254 |
| 10.20.30.40 | /16 | 255.255.0.0 | 10.20.0.0 | 10.20.255.255 | 65534 |
| 172.16.5.129 | /25 | 255.255.255.128 | 172.16.5.128 | 172.16.5.255 | 126 |
| 203.0.113.70 | /27 | 255.255.255.224 | 203.0.113.64 | 203.0.113.95 | 30 |
Formula Used
1. Prefix length counts network bits inside a 32-bit IPv4 address.
2. Host bits = 32 − prefix length.
3. Total addresses = 2host bits.
4. Usable hosts = total addresses − 2 for most subnets.
5. For /31, usable hosts can be 0 or 2, depending on policy.
6. For /32, the address identifies one host route.
7. Wildcard mask = 255.255.255.255 − subnet mask.
8. Network address = IP address AND subnet mask.
9. Broadcast address = network address OR inverted subnet mask.
How to Use This Calculator
- Enter a valid IPv4 address.
- Select whether you want to use a prefix length or subnet mask.
- Provide the matching prefix or mask value.
- Choose the host capacity rule for /31 behavior.
- Pick your preferred chart mode.
- Click Calculate Prefix Details.
- Review the result cards above the form.
- Use the CSV or PDF buttons to export the results.
Frequently Asked Questions
What is an IP prefix length?
A prefix length shows how many bits identify the network portion of an IPv4 address. It appears after a slash, such as /24.
How is prefix length related to subnet mask?
Prefix length and subnet mask describe the same boundary. For example, /24 equals 255.255.255.0, and /26 equals 255.255.255.192.
Can this calculator convert subnet masks to prefix lengths?
Yes. Choose subnet mask mode, enter a valid contiguous IPv4 mask, and the calculator derives the matching prefix length automatically.
What does wildcard mask mean?
A wildcard mask is the inverse of the subnet mask. It is commonly used in access control lists and routing filters.
Why are network and broadcast addresses important?
They mark the start and end of a subnet. Regular host assignments usually sit between these two boundary addresses.
How are usable hosts calculated?
For most subnets, usable hosts equal total addresses minus two. Special cases exist for /31 links and /32 host routes.
Does this page support IPv6 prefixes?
No. This version focuses on IPv4 addressing, subnet masks, ranges, and host counts for common planning tasks.
When should I use CIDR notation?
Use CIDR whenever you need flexible subnetting, route summarization, or efficient address allocation beyond old classful network boundaries.