IPv4 subnet calculator
Calculate network masks, host ranges, and CIDR blocks.
About IPv4 subnet calculator
Work out how an IPv4 address belongs to a CIDR network. The prefix length determines the network portion and the number of remaining address bits.
Steps, example, and limitations
How to use it
- Enter an IPv4 address and the required prefix or mask.
- Calculate the subnet.
- Review the network, broadcast, masks, and host range for your use case.
Example
Input
192.168.1.42/24
Result
Network: 192.168.1.0 Mask: 255.255.255.0 Broadcast: 192.168.1.255
Things to know
- This calculator covers IPv4, not IPv6.
- The /31 and /32 cases need special interpretation. A mathematical address range does not tell you which addresses are actually assigned or reachable.