The IP Subnet Calculator performs subnet calculations for the given network address block, subnet mask, and maximum required hosts per subnet. It determines the network address, usable host range, broadcast address, subnet mask, wildcard mask, binary subnet mask, IP class, CIDR notation, IP type, and more. Both IPv4 and IPv6 are supported.
Enter an IPv4 address and select a subnet mask (CIDR prefix) to calculate network address, broadcast address, usable host range, and more.
Enter an IPv6 address and select a prefix length to calculate the network range, total number of IP addresses, and full expanded address.
Carve a /24 into /30 subnets and half of your 256 addresses vanish: 64 subnets with 2 usable hosts each is 128 usable addresses. Even four /26s leave only 248 instead of 254. These are the numbers this page makes easy to see. Type an address, pick a prefix, press Calculate, and it shows the network and broadcast addresses, the host range, both masks and the count, with a separate IPv6 section further down.
The page treats the address as one 32-bit integer. Block size = 2^(32 − prefix). Network address = address − (address mod block size). Broadcast = network + block size − 1. Usable hosts = block size − 2, because the first address names the network and the last is the broadcast. The mask equals 2^32 minus the block size, and the wildcard mask is 4,294,967,295 minus the mask.
Typical case, the page default 111.88.17.130 /30. As an integer the address is 111 × 16,777,216 + 88 × 65,536 + 17 × 256 + 130 = 1,868,042,626. The block size is 4 and 1,868,042,626 mod 4 = 2, so the network is 111.88.17.128 and the broadcast is 111.88.17.131. Usable hosts run from .129 to .130, which is 2. The mask is 255.255.255.252, the wildcard is 0.0.0.3 and the hex ID is 0x6F581182. Note that a host address works fine as input; the page masks it down for you.
A prefix that is not on an octet boundary is where hand calculation slips. For 172.16.5.200 /20 the block is 4,096, giving network 172.16.0.0, broadcast 172.16.15.255, 4,094 usable hosts, mask 255.255.240.0 and wildcard 0.0.15.255. That block spans sixteen /24-sized slices (third octet 0 to 15), and the .5.200 address sits in the sixth of them.
Edge case: /31 and /32. For 192.168.1.10 /31 the block is 2, so the network is .10 and the broadcast is .11. The page lists a host range of .10 to .11 but reports 0 usable hosts, because its rule is usable = 0 for any prefix of 31 or longer. RFC 3021 allows both addresses of a /31 on a point-to-point link, so read that 0 as no conventional hosts. A /32 gives 1 total address, 0 usable, and is a single-host route. The prefix menu begins at /1, so /0 cannot be chosen.
The page applies the classic rule that two addresses are lost to the network and broadcast, so anything /31 or longer reports 0. Modern routers commonly use /31 for point-to-point links, where both addresses are assigned, as RFC 3021 describes. Check the host range line for those.
Almost never. Classes A, B and C are a legacy idea and the maths uses only the prefix you choose. The setting just rejects addresses outside the class, and the IP Class row in the result is informational.
The IP Type row recognises only 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, loopback and 169.254.0.0/16. Shared carrier address space (100.64.0.0/10) and documentation ranges such as 192.0.2.0/24 are not routable on the open internet, but they are shown as Public.
IPv6 has no broadcast address, so the page shows the total address count, 2^(128 − prefix), and the first and last address. The default 2001:db8:85a3::8a2e:370:7334 /64 gives 18,446,744,073,709,551,616 addresses from 2001:db8:85a3:: to 2001:db8:85a3:0:ffff:ffff:ffff:ffff.
Write the last 32 bits as two hex groups instead, in this case ::ffff:c000:201. The IPv6 parser reads groups as hexadecimal, so the dotted tail is misread rather than rejected. Also check IPv4 entries for stray characters, since 192.168.1.5x is accepted as 192.168.1.5.