What is an IP Subnet Calculator?
An IP subnet calculator takes an IPv4 address and a CIDR prefix (such as /24) and instantly works out the subnet mask, network address, broadcast address, the range of usable host addresses, and how many hosts the subnet can hold. It is an everyday tool for network engineers, sysadmins, and anyone studying for networking certifications. This tool covers standard IPv4 addressing and is not country-specific.
How to use it
Enter the four octets of your IPv4 address (each 0–255) and choose a CIDR prefix from 0 to 32. The calculator applies the mask to the IP using a bitwise AND, then derives every related value. The headline figure is the number of usable hosts; the table below it lists the network, mask, broadcast, host range, and total address count.
The formula explained
The subnet mask is a 32-bit value with the leftmost p bits set to 1. The number of host bits is \(32 - p\), so the block size (total addresses) is \(2^{(32 - p)}\). Two of those are reserved — the network address (all host bits 0) and the broadcast address (all host bits 1) — giving $$\text{usable hosts} = 2^{(32 - p)} - 2$$ The network address itself is computed as \(\text{IP} \mathbin{\&} \text{mask}\).
Worked example
For 192.168.1.10/24: host bits = \(32 - 24 = 8\), block size = \(2^8 = 256\), usable hosts = \(256 - 2 = 254\). The mask is 255.255.255.0, the network is 192.168.1.0, the broadcast is 192.168.1.255, and the usable host range is 192.168.1.1 to 192.168.1.254.
FAQ
Why subtract 2 from the host count? The network and broadcast addresses cannot be assigned to a device, so they are removed from the usable total.
What about /31 and /32? A /31 is used for point-to-point links and provides 2 usable addresses (no broadcast reserved); a /32 represents a single host. This calculator handles those special cases.
Does it support IPv6? No — this tool is for IPv4 (32-bit) addressing only.