How this calculation works
The IP Subnet & CIDR Calculator computes network boundaries, broadcast addresses, subnet masks, wildcard masks, and usable host address ranges for IPv4 network engineering.
Mathematical formula and logic
Total Hosts = 2^(32 - CIDR). Usable Hosts = 2^(32 - CIDR) - 2 (subtracting Network and Broadcast addresses).
Worked example
For IP 192.168.1.50 with CIDR /24 (255.255.255.0): Network Address is 192.168.1.0, Broadcast is 192.168.1.255, Usable Host Range is 192.168.1.1 to 192.168.1.254 (254 usable host addresses).
Calculation assumptions
- Standard IPv4 addressing based on RFC 791 / RFC 4632.
- First address is reserved as the Network ID and last address is reserved as the Subnet Broadcast.
Frequently asked questions
Why are 2 addresses subtracted from the total host count in a subnet?
In standard IPv4 subnets, the very first address represents the Network Identifier (used by routers) and the last address is the Broadcast Address (used to send packets to all hosts in the subnet).
What is CIDR notation?
Classless Inter-Domain Routing (CIDR) notation expresses a subnet mask as a slash followed by the count of leading 1 bits in the mask (e.g. /24 equals 255.255.255.0).
What is a /30 subnet used for?
A /30 subnet provides exactly 2 usable IP addresses (4 total), making it the standard choice for point-to-point router-to-router links.
What are private IPv4 address ranges (RFC 1918)?
Private IP ranges for local networks are: 10.0.0.0/8 (Class A), 172.16.0.0/12 (Class B), and 192.168.0.0/16 (Class C).
What is a wildcard mask?
A wildcard mask is the bitwise inverse of a subnet mask (e.g. Subnet 255.255.255.0 has a Wildcard mask of 0.0.0.255), frequently used in Cisco ACLs and OSPF network statements.