calculatorgate.com
Home
/IP Subnet Calculator

IP Subnet Calculator

Calculate the network address, broadcast address, subnet mask, and usable host count from an IPv4 address and CIDR prefix.

Last updated: November 14, 2026

About IP Subnet Calculation

What is subnetting and how is it calculated?

Subnetting is the process of dividing a larger IP network into smaller, manageable subnetworks. Given an IPv4 address and a CIDR prefix length (e.g. /24), you can calculate the subnet mask, network address, broadcast address, and the number of usable hosts on that network.

The prefix length specifies how many bits of the address are reserved for the network portion; the remaining bits form the host portion. For example, a /24 prefix leaves 8 host bits, giving a network of 256 addresses (254 usable). /31 and /32 prefixes are special cases with no usable hosts (used for point-to-point links or single-host definitions).

The wildcard mask is the bitwise inverse of the subnet mask and is commonly used in access control lists (ACLs).

Frequently asked questions

Short answers to common questions

What does a CIDR prefix like /24 mean?

A CIDR prefix indicates how many bits of the IP address belong to the network portion. /24 means the first 24 bits of the 32-bit address are the network portion and the remaining 8 bits are the host portion, corresponding to a subnet mask of 255.255.255.0.

Why is the usable host count 2 less than the total addresses?

The first address in a subnet is reserved as the network address and the last as the broadcast address, so neither can be assigned to a host. That's why the usable host count is calculated as the total addresses (2^host bits) minus 2.

Why are there no usable hosts for /31 and /32?

A /32 represents a single host address (no host bits), and a /31 contains only 2 addresses, typically used for point-to-point links where both addresses are usable as hosts. The standard network/broadcast split doesn't apply to these prefixes, so the conventional 'usable host' count is treated as 0.

What is a wildcard mask?

A wildcard mask is the bitwise inverse of the subnet mask (for 255.255.255.0, the wildcard is 0.0.0.255). It's commonly used in Cisco access control lists (ACLs) and OSPF configurations to specify which addresses should match.