IP Subnet Calculator

Find subnet details from a CIDR prefix.

How it is calculated

An IPv4 address has 32 bits, and the CIDR prefix /p says how many of the leading bits identify the network. total addresses = 2(32 − p). usable hosts = total − 2, because the first address is the network address and the last is the broadcast address; for /31 and /32 (two or fewer addresses) the tool shows the total itself. The netmask is p ones followed by zeros written in dotted decimal, and the wildcard mask is its bitwise inverse, as used in access lists. The prefix must be 0 to 32 and is rounded to a whole number.

Worked example

Prefix /24. Host bits = 32 − 24 = 8, so total addresses = 28 = 256. Usable hosts = 256 − 2 = 254. The mask has 24 ones: 255.255.255.0. The wildcard is the inverse, 0.0.0.255.

Try this example →

Common mistakes

  • Counting all 256 addresses as usable hosts; the network and broadcast addresses cannot be given to devices in a normal subnet.
  • Confusing the netmask with the wildcard mask in ACLs, where Cisco-style syntax expects the wildcard.
  • Entering the netmask (255.255.255.0) instead of the prefix length (24).
  • Assuming a /31 has zero usable hosts; point-to-point links use both addresses, and this tool reports 2.
  • Forgetting that the tool takes only the prefix; it does not compute the network address of a specific host IP.

About this calculator

This calculator turns a CIDR prefix (like /24) into full subnet details: the subnet mask (e.g. /24 → 255.255.255.0), the wildcard mask (its bitwise inverse, used in access-control-list rules), the total address count (2 raised to the power of the remaining host bits), and the usable host count, which subtracts two addresses reserved for the network address and the broadcast address. A /24 network, for instance, has 256 total addresses but only 254 usable for hosts.

Network engineers and system administrators use this daily when designing IP address schemes, splitting a larger network into smaller subnets (subnetting) or combining several into one (supernetting/CIDR aggregation), and configuring VLANs and firewall rules; students preparing for certifications like CompTIA Network+ or Cisco's CCNA rely on it to check subnetting practice problems; and cloud engineers use the same math to plan VPC and subnet address ranges.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The usable host count shown is the classic network-minus-two figure, but some cloud providers reserve more. AWS holds back five addresses in every subnet, so a /28 that shows 14 usable here leaves 11 in practice. Check your provider's documentation before sizing a VPC. The tool takes only the prefix and does not locate a particular host. Which environment are you planning, cloud or on-premises?

Popular calculators

All Calculators