NetCalc
Subnet Calculator
IP + CIDR prefix in, full subnet details out — network, broadcast, host range.
Subnet mask, host count, and range by CIDR prefix
The prefix says how many bits are network; the rest address hosts. Two addresses in every block are reserved for the network and broadcast, which is why usable hosts is always two fewer than the block size.
| CIDR | Subnet mask | Network | Broadcast | Usable range | Usable hosts |
|---|---|---|---|---|---|
| 192.168.1.10/24 | 255.255.255.0 | 192.168.1.0 | 192.168.1.255 | 192.168.1.1 - 192.168.1.254 | 254 |
| 192.168.1.10/25 | 255.255.255.128 | 192.168.1.0 | 192.168.1.127 | 192.168.1.1 - 192.168.1.126 | 126 |
| 192.168.1.10/26 | 255.255.255.192 | 192.168.1.0 | 192.168.1.63 | 192.168.1.1 - 192.168.1.62 | 62 |
| 192.168.1.10/30 | 255.255.255.252 | 192.168.1.8 | 192.168.1.11 | 192.168.1.9 - 192.168.1.10 | 2 |
| 172.16.5.1/20 | 255.255.240.0 | 172.16.0.0 | 172.16.15.255 | 172.16.0.1 - 172.16.15.254 | 4,094 |
| 10.0.0.5/16 | 255.255.0.0 | 10.0.0.0 | 10.0.255.255 | 10.0.0.1 - 10.0.255.254 | 65,534 |
| 10.0.0.5/8 | 255.0.0.0 | 10.0.0.0 | 10.255.255.255 | 10.0.0.1 - 10.255.255.254 | 16,777,214 |
Note the /30 row: 192.168.1.10 sits in the block starting at 192.168.1.8, not at .10. The network address is the given IP masked down, which is why the block boundary often surprises people. /30 is the classic point-to-point link size.
How CIDR notation works
A /24 means the first 24 bits are the network portion, leaving 8 bits (2⁸ = 256 addresses, 254 usable hosts) for hosts. Each step down (/25, /26, …) halves the host count. The subnet mask is just those network bits set to 1 — /24 = 255.255.255.0, /16 = 255.255.0.0.
Why subtract 2 from total addresses
The first address in a subnet is the network address (identifies the subnet itself) and the last is the broadcast address (reaches all hosts on the subnet). Neither can be assigned to a device, so usable hosts = 2^(32 − prefix) − 2. A /31 is a special case used for point-to-point links.
Frequently asked questions
I have a /24 subnet — how many devices can I connect?
254 usable host addresses (256 total minus the network address and broadcast address). A /24 gives you addresses x.x.x.1 through x.x.x.254 for devices.
What's the subnet mask for a /24?
255.255.255.0. The first 24 bits are set to 1 (the network portion), and the remaining 8 bits are 0 (the host portion). Each step down halves the hosts: /25 = 255.255.255.128 with 126 hosts, /26 = 255.255.255.192 with 62 hosts.
My office has 50 devices — what CIDR prefix do I need?
A /26 gives 62 usable hosts, which fits 50 devices with a little room. A /25 gives 126 hosts if you want more headroom. Avoid a /24 for just 50 devices unless you expect significant growth — it wastes address space in larger network designs.
What's the difference between a network address and a broadcast address?
The network address (first in the range) identifies the subnet itself and can't be assigned to a device. The broadcast address (last in the range) sends packets to all hosts on the subnet simultaneously. Both are reserved, which is why usable hosts = total addresses minus 2.
Can I subnet a subnet?
Yes — it's called variable-length subnet masking (VLSM). You can take a /24 and split it into smaller subnets like two /25s or four /26s. Each sub-subnet follows the same math but with a longer prefix.
Related Developer calculators
Chmod Calculator
Convert between octal and symbolic Unix file permission notation.
OpenColor Contrast Calculator
WCAG contrast ratio between two colors with AA/AAA pass/fail.
OpenSSL Certificate Expiry Calculator
Check days remaining until an SSL/TLS certificate expires.
OpenJWT Decoder
Decode a JWT token into header, payload, and expiration status.
OpenLast updated: September 7, 2026