Subnet Calculator
Enter an IPv4 address and CIDR prefix to get the network, broadcast, host range, and masks.
IPv4 subnet and CIDR calculator
Type any IPv4 address and pick a CIDR prefix length to instantly see the network address, broadcast address, usable host range, subnet mask, and wildcard mask, plus the total and usable host counts. Everything is computed in your browser with plain integer bit math, so nothing is uploaded and the results are exact.
The subnet mask is built by setting the top bits of a 32-bit value according to the prefix length, the network address is the IP masked with it, and the broadcast address fills the remaining host bits. The usable range normally excludes the network and broadcast addresses, but the tool follows the standard exceptions for /31 and /32 networks.
FAQ
What is CIDR notation? CIDR writes a network as an address followed by a slash and a prefix length, like 192.168.1.0/24. The prefix length is the number of leading bits that identify the network; the remaining bits identify hosts.
Why are there two fewer usable hosts than total addresses? The first address in a block is the network identifier and the last is the broadcast address, so neither can be assigned to a host. A /24 has 256 addresses but 254 usable hosts.
How do /31 and /32 work? A /32 describes a single host (one address, one usable). A /31 is used for point-to-point links under RFC 3021, where both addresses are usable, giving 2 usable hosts and no separate broadcast.
What is the wildcard mask? The wildcard mask is the bitwise inverse of the subnet mask (for example 0.0.0.255 for a /24). It is used in access control lists and routing rules to match the host portion of an address.