IP Subnet Calculator
Get the network, broadcast, mask, wildcard, and host range from any IPv4 address and CIDR prefix.
The network and broadcast addresses are reserved, so usable hosts = total − 2.
For 192.168.1.10/24 the network address is 192.168.1.0 and the broadcast is 192.168.1.255, with a subnet mask of 255.255.255.0 and wildcard 0.0.0.255. That leaves 254 usable hosts (192.168.1.1 to 192.168.1.254) out of 256 total addresses — the network and broadcast addresses are reserved.
What a subnet calculator works out
An IPv4 address is a 32-bit number, and a CIDR prefix like /24 says how many of those bits identify the network. Everything to the left of the prefix is the network portion; everything to the right is the host portion. From just an address and a prefix you can derive the whole block: the network address (all host bits set to 0), the broadcast address (all host bits set to 1), the subnet mask and its inverse the wildcard mask, and the range of addresses that can be assigned to real devices.
Total addresses = 2^(32 − prefix). The −2 removes the network and broadcast addresses (see /31 and /32 exceptions below).
Worked example: 192.168.1.10/24
A /24 keeps the first 24 bits as the network and leaves the last 8 bits (one octet) for hosts, so there are 2⁸ = 256 addresses in the block.
- 1 Build the mask from the prefix. A /24 sets the top 24 bits to 1: 11111111.11111111.11111111.00000000 = 255.255.255.0. The wildcard is the inverse, 0.0.0.255.
- 2 Find the network address (IP AND mask). 192.168.1.10 AND 255.255.255.0 zeroes the host bits, giving 192.168.1.0.
- 3 Find the broadcast address (network OR wildcard). 192.168.1.0 OR 0.0.0.255 sets every host bit, giving 192.168.1.255.
- 4 Count the hosts. Host bits = 32 − 24 = 8, so total = 2⁸ = 256 and usable = 256 − 2 = 254.
- 5 Read off the usable range. First host = network + 1 = 192.168.1.1; last host = broadcast − 1 = 192.168.1.254.
Common CIDR prefixes
Total addresses, usable hosts, and subnet mask for frequently used IPv4 prefixes.
| Prefix | Total addresses | Usable hosts | Subnet mask |
|---|---|---|---|
| /24 | 256 | 254 | 255.255.255.0 |
| /25 | 128 | 126 | 255.255.255.128 |
| /26 | 64 | 62 | 255.255.255.192 |
| /27 | 32 | 30 | 255.255.255.224 |
| /28 | 16 | 14 | 255.255.255.240 |
| /30 | 4 | 2 | 255.255.255.252 |
| /32 | 1 | 1 | 255.255.255.255 |
Network vs broadcast, and why you subtract 2
Inside every ordinary subnet, two addresses are reserved and cannot be assigned to a device. The network address — all host bits 0 — names the subnet itself and is what appears in routing tables. The broadcast address — all host bits 1 — reaches every host on the subnet at once. Because both are taken, the usable host count is total − 2. Two prefixes break this rule: a /31 has only two addresses and, under RFC 3021, both are usable for point-to-point links, so there is no separate broadcast. A /32 describes a single host — one address with no network or broadcast to reserve — commonly used for loopbacks and host routes.