IP Subnet Calculator
Calculate the network address, broadcast address, subnet mask, and usable host range for an IPv4 address.
Enter your values to calculate your result.
Formula
Subnet Mask = 32 contiguous 1-bits (per the prefix length) Network Address = IP AND Mask Broadcast Address = Network OR (NOT Mask)
The CIDR prefix length determines how many leading bits of the subnet mask are 1s. ANDing the IP address with this mask gives the network address (the subnet's identity), while setting all the non-masked bits to 1 gives the broadcast address (the subnet's last address). The addresses in between, excluding both, are usable for hosts — except for the special /31 (point-to-point, both addresses usable, RFC 3021) and /32 (a single host) cases.
Example
192.168.1.0/24 has a subnet mask of 255.255.255.0, a network address of 192.168.1.0, a broadcast address of 192.168.1.255, and 254 usable host addresses (192.168.1.1 through 192.168.1.254).
Frequently Asked Questions
What's special about /31 and /32?
A /32 identifies a single exact address (no network/broadcast distinction). A /31 (RFC 3021) is reserved for point-to-point links and treats both of its 2 addresses as usable hosts, with no broadcast address at all — an exception to the usual 'subtract 2' rule.
Why do I enter the IP address as 4 separate fields?
Each field is one octet (0-255) of the dotted-decimal address — entering 192, 168, 1, 0 represents the address 192.168.1.0.

