Enter the IPv4 address as four octets and the CIDR prefix length, the number after the slash. A /24 prefix means the first 24 bits identify the network and the last 8 identify hosts. The network address is the address with all host bits set to zero, and the broadcast address is the address with all host bits set to one.
The usable host count is 2 raised to the number of host bits, minus 2, because the network and broadcast addresses cannot be assigned to devices.
Subnet: worked example
| CIDR prefix length | 24 |
|---|---|
| IP address, first octet | 192 |
| IP address, second octet | 168 |
| IP address, third octet | 1 |
| IP address, fourth octet | 0 |
| Usable host addresses | 254 |
| Network address | 192.168.1.0 |
| Broadcast address | 192.168.1.255 |
Subnet: formula
A /31 has no broadcast and is used for point-to-point links, and a /32 is a single host, so the minus-2 rule does not apply there. Private ranges such as 192.168.0.0/16 and 10.0.0.0/8 are not routed on the internet. IPv6 uses 128-bit addresses and a different convention.
Real networks also reserve addresses for gateways and infrastructure.
Common error: Applying the minus-two host rule to every prefix. RFC 3021 point-to-point links are a separate address-usage case from ordinary broadcast subnets.
Subnet: changing CIDR prefix length
| CIDR prefix length | Usable host addresses | Network address | Broadcast address |
|---|---|---|---|
| 19 | 8,190 | 192.168.0.0 | 192.168.31.255 |
| 22 | 1,022 | 192.168.0.0 | 192.168.3.255 |
| 24 (example) | 254 | 192.168.1.0 | 192.168.1.255 |
| 26 | 62 | 192.168.1.0 | 192.168.1.63 |
| 29 | 6 | 192.168.1.0 | 192.168.1.7 |
Subnet: compare input ranges
| Input | Tested from | To | Usable host addresses: low input | Usable host addresses: high input | Swing |
|---|---|---|---|---|---|
| CIDR prefix length | 22 | 26 | 1,022 | 62 | 960 (378%) |
| IP address, first octet | 173 | 211 | 254 | 254 | 0 |
| IP address, second octet | 151 | 185 | 254 | 254 | 0 |
| IP address, third octet | 0 | 2 | 254 | 254 | 0 |
| IP address, fourth octet | 0 | 1 | 254 | 254 | 0 |
Subnet: individual input comparisons
| Input | Value | Usable host addresses | Network address | Broadcast address |
|---|---|---|---|---|
| CIDR prefix length | 19 | 8,190 | 192.168.0.0 | 192.168.31.255 |
| 22 | 1,022 | 192.168.0.0 | 192.168.3.255 | |
| 24 | 254 | 192.168.1.0 | 192.168.1.255 | |
| 26 | 62 | 192.168.1.0 | 192.168.1.63 | |
| 29 | 6 | 192.168.1.0 | 192.168.1.7 | |
| IP address, first octet | 154 | 254 | 154.168.1.0 | 154.168.1.255 |
| 173 | 254 | 173.168.1.0 | 173.168.1.255 | |
| 192 | 254 | 192.168.1.0 | 192.168.1.255 | |
| 211 | 254 | 211.168.1.0 | 211.168.1.255 | |
| 230 | 254 | 230.168.1.0 | 230.168.1.255 | |
| IP address, second octet | 134 | 254 | 192.134.1.0 | 192.134.1.255 |
| 151 | 254 | 192.151.1.0 | 192.151.1.255 | |
| 168 | 254 | 192.168.1.0 | 192.168.1.255 | |
| 185 | 254 | 192.185.1.0 | 192.185.1.255 | |
| 202 | 254 | 192.202.1.0 | 192.202.1.255 | |
| IP address, third octet | 0 | 254 | 192.168.0.0 | 192.168.0.255 |
| 0 | 254 | 192.168.0.0 | 192.168.0.255 | |
| 1 | 254 | 192.168.1.0 | 192.168.1.255 | |
| 2 | 254 | 192.168.2.0 | 192.168.2.255 | |
| 3 | 254 | 192.168.3.0 | 192.168.3.255 | |
| IP address, fourth octet | 0 | 254 | 192.168.1.0 | 192.168.1.255 |
| 0 | 254 | 192.168.1.0 | 192.168.1.255 | |
| 0 | 254 | 192.168.1.0 | 192.168.1.255 | |
| 1 | 254 | 192.168.1.0 | 192.168.1.255 | |
| 2 | 254 | 192.168.1.0 | 192.168.1.255 |
Subnet: which assumptions move the result?
Subnet: values and definitions
| Quantity and definition | Value used |
|---|---|
| CIDR prefix length — The number after the slash, e.g. the 24 in 192.168.1.0/24. 0-32. | 24 |
| IP address, first octet | 192 |
| IP address, second octet | 168 |
| IP address, third octet | 1 |
| IP address, fourth octet | 0 |
| Usable host addresses | 254 |
| Network address | 192.168.1.0 |
| Broadcast address | 192.168.1.255 |
Networking & Technology calculators: Password Entropy Calculator, Download Time Calculator, Storage Converter Calculator, Aspect Ratio Calculator, PPI (Pixels Per Inch) Calculator, Bandwidth and Data Usage Calculator.
A CIDR prefix trades address count for the number of separate networks you can carve out of one block: moving from a /24 to a /26 quarters the usable hosts per subnet but yields four separate subnets instead of one, which matters the moment a network needs to be segmented for security, VLANs or a multi-site design rather than left as one flat range.
Confirm the prefix matches what your router or switch has configured before assuming a device sits inside a given subnet; a device with the right-looking IP address but the wrong mask can silently fail to reach its own gateway.
Estimate the throughput a network needs on the bandwidth calculator, the time a transfer takes on the download time calculator and unit sizes on the storage converter. The password entropy calculator covers account security, and the aspect ratio and PPI pages handle display math for the same tech audience.
Subnet Calculator: quantities and terminology
How many hosts are in a /24 network?
A /24 has 256 addresses, of which 254 are usable after the network and broadcast addresses are set aside.
What does the number after the slash mean?
It is the count of leading bits that identify the network, so a larger number gives a smaller subnet.
Why subtract two from the host count?
The all-zeros host address names the network itself and the all-ones address is the broadcast, so neither can be given to a device.