IPv4 Subnet Calculator
Enter an IPv4 address and prefix length to get the network, broadcast, mask and host range.
Your numbers
Your results
IPv4 Subnet Calculator by TheCalcTools
How the IPv4 Subnet Calculator works
Enter the four octets of an IPv4 address and the prefix length from the CIDR notation (for example /26).
The prefix length says how many leading bits identify the network. The remaining bits identify hosts, so the block holds 2^(32 − prefix) addresses.
The network address is the first address in the block and the broadcast address is the last. Usable hosts exclude those two, except on /31 and /32 blocks.
The formula
Worked example
Using the default values shown in the calculator:
| Octet 1 | 192 |
|---|---|
| Octet 2 | 168 |
| Octet 3 | 10 |
| Octet 4 | 77 |
| Prefix length (/n) | 26 |
- 192.168.10.77/26 has a block of 2^(32 − 26) = 64 addresses.
- The block containing .77 starts at 192.168.10.64 and ends at 192.168.10.127.
- Usable hosts: 192.168.10.65 to 192.168.10.126, which is 62 hosts. The mask is 255.255.255.192.
Result:
| Network address | 192.168.10.64 |
|---|---|
| Subnet mask | 255.255.255.192 |
| Wildcard mask | 0.0.0.63 |
| Broadcast address | 192.168.10.127 |
| First usable host | 192.168.10.65 |
| Last usable host | 192.168.10.126 |
| Total addresses | 64 |
| Usable hosts | 62 |
Frequently asked questions
What is the difference between the subnet mask and the wildcard mask?
The wildcard mask is the inverse of the subnet mask. Subnet masks have 1s in the network bits; wildcard masks have 1s in the host bits. Cisco ACLs use wildcard masks.
Why are two addresses unusable?
The first address names the network and the last is the broadcast address, so neither can be assigned to a normal host.
How do /31 and /32 work?
RFC 3021 allows a /31 for point-to-point links with two usable addresses. A /32 identifies a single host.
Sources and further reading
- Wikipedia: Subnetwork
- RFC 4632: Classless Inter-domain Routing (CIDR)
- RFC 3021: 31-Bit Prefixes on IPv4 Point-to-Point Links
Related calculators
More in IP & Domain Tools · All calculators
This calculator gives estimates for information only. Check important results independently before you rely on them. See our disclaimer.
