What is the IP Subnet Calculator?
This tool takes an IPv4 address (four octets, 0–255) and a CIDR prefix length (/0 to /32) and computes everything you need to plan or document a subnet: the network address, broadcast address, subnet mask, wildcard mask, the first and last usable host, and the total and usable host counts. It works entirely with standard 32-bit IPv4 binary math, so it applies to any network worldwide.
How to use it
Enter the four octets of your IP address and choose the subnet prefix. For example, 192.168.1.10/24 means octets 192, 168, 1, 10 with a prefix of 24. Press calculate and read the network details below.
The formula explained
The subnet mask is built by setting the leftmost prefix bits to 1 and the rest to 0. The network address is the bitwise AND of the IP and the mask. The broadcast address is the network OR'd with the inverted mask (the wildcard). The number of total addresses is \(2^{32 - \text{prefix}}\), and the usable host count subtracts 2 for the network and broadcast addresses: $$H = 2^{\,32 - \text{prefix}} - 2$$.
Worked example
For 192.168.1.10/24, the mask is 255.255.255.0. Network = 192.168.1.0, broadcast = 192.168.1.255. Total addresses = \(2^8 = 256\), usable hosts = \(256 - 2 = 254\). First usable host is 192.168.1.1 and the last is 192.168.1.254.
FAQ
Why subtract 2 from the host count? The first address is reserved as the network identifier and the last is the broadcast address, so neither can be assigned to a device.
What about /31 and /32? A /32 describes a single host, and a /31 is used for point-to-point links (RFC 3021) where both addresses are usable.
Does this support IPv6? No — this calculator is for IPv4 only.