home/other/ip subnet calculator

IP Subnet Calculator

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.

IPv4 Subnet Calculator

Enter an IPv4 address and select a subnet mask (CIDR prefix) to calculate network address, broadcast address, usable host range, and more.

▼Modify the values and click the Calculate button to use

IPv6 Subnet Calculator

Enter an IPv6 address and select a prefix length to calculate the network range, total number of IP addresses, and full expanded address.

▼Modify the values and click the Calculate button to use

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.

Block Size, Network and Broadcast Math

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.

How to Use This Calculator

  1. Leave Network Class on Any unless you want a check. Choosing A, B or C only validates the first octet (1 to 126, 128 to 191 or 192 to 223) and shows an error if it does not fit.
  2. Pick the Subnet from the dropdown. It lists each mask with its prefix, from 255.128.0.0 /1 to 255.255.255.255 /32, and starts at 255.255.255.252 /30.
  3. Type the IP Address in dotted form, for example 192.168.1.0.
  4. Press Calculate. Nothing updates until you do, and Clear returns every field to the defaults.
  5. Read the main Result table, then the second table (binary, integer and hex forms, the in-addr.arpa name, the IPv4-mapped address and the 6to4 prefix), then the table of every network of that size.
  6. For IPv6, use the separate section: choose a prefix from /1 to /128, enter the address and press Calculate.

Frequently Asked Questions

Why does a /31 show zero usable hosts?

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.

Do I need to set the Network Class?

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.

Why is my 100.64.x.x or 192.0.2.x address labelled Public?

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.

How is the IPv6 section different?

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.

Can I type an IPv4-style tail, like ::ffff:192.0.2.1, into the IPv6 box?

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.