Subnet Calculator

—

From an IPv4 address and a CIDR prefix, list the network, broadcast, mask, host range, address count, and usable hosts. IPv6 is not accepted.

How to use

  1. Type an IPv4 address in IP address. The sample is 192.168.1.10. Four numbers from 0 to 255, separated by dots, are required.
  2. Type a prefix in CIDR / Prefix. The field allows 0 through 32. The sample is 24.
  3. Press Calculate. The sample shows 192.168.1.0/24. The detail lists Mask 255.255.255.0, Network 192.168.1.0, Broadcast 192.168.1.255, Host range 192.168.1.1 – 192.168.1.254, and Addresses: 256 (254 usable).
  4. A bad address, a missing octet, or a prefix outside 0 to 32 shows Invalid IP or CIDR. 192.168.1.256 and a prefix of 33 both fail that way.

When it helps

Check a home LAN prefix before you assign a static host, or confirm why 192.168.1.0 and 192.168.1.255 are not ordinary hosts on a /24. The address count is 2 raised to the power of 32 minus the prefix. Usable hosts are that count minus 2 for an ordinary prefix, which is why /24 prints 254 usable out of 256 addresses.

The unit converter and the scientific calculator are other calculators, not network tools. Use them for unrelated math, such as converting a measurement or evaluating a power, not for routing.

Limits

IPv4 only. An IPv6 address will not parse and shows Invalid IP or CIDR. The page does not split a block into several subnets, does not print a binary worksheet, and does not label private versus public ranges. /31 and /32 are the exception to the usual host-range trim: their range includes the network and the broadcast instead of skipping those ends.

The parenthetical usable count is still the address total minus 2, and it is never shown below zero. A /31 has 2 addresses so the usable figure prints as 0. A /32 has 1 address so the usable figure also prints as 0, while the host range is that single address.

Questions

What does /24 mean for the sample?

The first 24 bits are the network. 192.168.1.10 falls in 192.168.1.0 through 192.168.1.255, with usable hosts 192.168.1.1 through 192.168.1.254.

Why is /31 usable shown as 0?

The address count is 2, and the usable number printed in parentheses is that count minus 2. The host range still lists both addresses, because /31 and /32 do not drop the ends the way a /24 does.

Can this plan an IPv6 prefix?

No. Only dotted IPv4 and a CIDR from 0 to 32 are accepted. Anything else stops at Invalid IP or CIDR.