Enter an IP address and CIDR prefix to calculate subnet details
Subnetting divides a larger network into smaller, more manageable segments called subnets. Each subnet has a network address, a broadcast address, and a range of usable host addresses in between. The subnet mask determines which portion of an IP address identifies the network and which portion identifies individual hosts.
A CIDR notation like /24 means the first 24 bits of the address define the network, leaving 8 bits for host addresses. With 8 host bits, you get 2⁸ = 256 total addresses, minus 2 (network and broadcast) = 254 usable hosts.
| CIDR | Subnet mask | Total IPs | Usable hosts |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 |
| /28 | 255.255.255.240 | 16 | 14 |
| /26 | 255.255.255.192 | 64 | 62 |
| /24 | 255.255.255.0 | 256 | 254 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
Every IP address is 32 bits. The subnet mask splits these bits into two parts: network bits (identify the subnet) and host bits (identify individual devices). All devices on the same subnet share the same network portion. The network address has all host bits set to 0, and the broadcast address has all host bits set to 1. Neither can be assigned to a host.
| Class | Range | CIDR | Total addresses |
|---|---|---|---|
| A | 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| B | 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| C | 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 |
A subnet mask is a 32-bit number that separates the network portion of an IP address from the host portion. In dotted decimal notation, 255.255.255.0 means the first 24 bits are network and the last 8 bits are host. In CIDR notation, this is written as /24.
A /24 subnet has 256 total addresses. Subtract 2 for the network address (first) and broadcast address (last), leaving 254 usable host addresses.
A /24 provides 254 usable hosts. A /25 splits that in half, providing 126 usable hosts per subnet. Each additional CIDR bit halves the number of available hosts.
CIDR (Classless Inter-Domain Routing) notation uses a slash followed by a number to indicate how many bits of the IP address are used for the network portion. /24 means 24 network bits and 8 host bits.
The first address is the network address (used to identify the subnet) and the last address is the broadcast address (used to send data to all hosts on the subnet). Neither can be assigned to a device.