Calculate network details from IP address and CIDR prefix.
| CIDR | Subnet Mask | Total IPs | Usable Hosts | Class |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | A |
| /16 | 255.255.0.0 | 65,536 | 65,534 | B |
| /24 | 255.255.255.0 | 256 | 254 | C |
| /25 | 255.255.255.128 | 128 | 126 | - |
| /26 | 255.255.255.192 | 64 | 62 | - |
| /27 | 255.255.255.224 | 32 | 30 | - |
| /28 | 255.255.255.240 | 16 | 14 | - |
| /29 | 255.255.255.248 | 8 | 6 | - |
| /30 | 255.255.255.252 | 4 | 2 | - |
CIDR (Classless Inter-Domain Routing) notation is a compact way to specify an IP address and its network mask. The number after the slash indicates how many bits form the network portion. For example, /24 means 24 network bits and 8 host bits, giving 256 addresses.
The network address is the first address in a subnet (all host bits set to 0) and identifies the network itself. The broadcast address is the last address (all host bits set to 1) and sends data to all hosts. Neither can be assigned to a device as a host address.
A /24 subnet contains 256 total addresses (2^8). Subtracting 2 for the network and broadcast addresses gives 254 usable host addresses. The general formula is: usable hosts = 2^(32 - prefix) - 2.