IP Subnet Calculator

Splitting an IPv4 Address Into Network and Host

Every IPv4 address carries two pieces of information at once: which network it belongs to, and which host it identifies within that network. The subnet mask (or its CIDR shorthand, like /24) is what draws the line between the two. Get the mask wrong and two devices that should be able to talk directly end up routed through a gateway unnecessarily — or worse, two networks that should be separate end up overlapping.

The Formula

This calculator builds an IPv4 network from the address and mask/CIDR you supply, then derives every other value from it:

Network Address = IP AND Subnet Mask
Broadcast Address = Network Address OR Wildcard Mask
Total Addresses = 2^(32 − CIDR prefix length)
Usable Hosts = Total Addresses − 2  (for prefixes /1–/30)

The −2 accounts for the network address and broadcast address, neither of which can be assigned to a host. A /31 network is a documented exception (point-to-point links, 2 usable addresses, no broadcast) and a /32 is a single host address.

Where Subnetting Matters

  • Network design — splitting a large allocated block into smaller subnets for different departments, VLANs, or sites without wasting address space.
  • Firewall and ACL rules — writing rules that match an entire subnet (e.g. 10.0.5.0/24) rather than every device individually.
  • Troubleshooting — confirming whether two hosts are on the same broadcast domain, which determines whether they can communicate without a router.
  • Capacity planning — choosing a prefix length that leaves headroom for future devices without over-allocating a scarce address block.

Common IPv4 Prefixes

Subnet mask, total addresses, and usable hosts by CIDR prefix
PrefixSubnet MaskTotal AddressesUsable Hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

/16 (255.255.0.0) gives 65,536 total addresses; /8 (255.0.0.0) gives 16,777,216 — both far larger than a typical local network needs.

How to Use This Calculator

  1. Enter the IP Address, for example 192.168.1.10.
  2. Enter the Subnet Mask or CIDR value, either as a dotted mask (255.255.255.0) or a prefix length (24).
  3. Select Calculate to get the network address, broadcast address, wildcard mask, usable host range, and total address count.

Related Calculations

Need to reason about the raw binary behind a mask? The Binary Calculator converts between binary, decimal, and hex. For estimating how much traffic a network needs to carry, see the Bandwidth Calculator.