IPv4 subnet calculator
Enter any IPv4 host address and CIDR prefix to identify its subnet and addressing details.
How to calculate an IPv4 subnet with CIDR
An IPv4 address contains 32 bits. The CIDR prefix indicates how many of those bits identify the network, while the remaining bits identify addresses inside the subnet. For example, /24 means 24 network bits and 8 host bits, producing the subnet mask 255.255.255.0.
Network address, broadcast and usable host range
For conventional prefixes from /0 through /30, the first address identifies the subnet and the last address is the directed broadcast address. Addresses between them form the traditional usable host range. /31 and /32 require different interpretation and are handled separately by this calculator.
Why a /31 can have two usable addresses
RFC 3021 defines the use of 31-bit IPv4 prefixes on point-to-point links. In this context, the two addresses that would traditionally look like network and broadcast addresses are interpreted as host addresses for the two endpoints, reducing address consumption on point-to-point infrastructure.
Subnet mask versus wildcard mask
The subnet mask marks the network-prefix bits with 1s. The wildcard is its bitwise inverse: mask bits set to 1 become 0 and vice versa. Wildcards are widely encountered in network configurations such as access control lists and routing-related match rules, depending on platform and syntax.
Public, private and special-purpose IPv4 addresses
Not every syntactically valid IPv4 address is globally routable. Private RFC 1918 ranges, shared address space, loopback, link-local, documentation, multicast and other special-purpose ranges have specific roles. The calculator identifies common address scopes to make the result more useful for network planning and troubleshooting.