Subnet Calculator
Calculate network, broadcast, host range, and wildcard mask for any IPv4 or IPv6 CIDR. Runs entirely in your browser — nothing is sent to a server.
| Network | 192.168.1.0/24 |
| Prefix length | /24 |
| Subnet mask | 255.255.255.0 |
| Wildcard mask | 0.0.0.255 |
| Broadcast | 192.168.1.255 |
| First host | 192.168.1.1 |
| Last host | 192.168.1.254 |
| Total addresses | 256 |
| Usable host IPs | 254 |
| Scope | Private |
Note: For /31 and /32 IPv4 blocks, host range and broadcast concepts don't apply traditionally — RFC 3021 defines /31 as point-to-point with both addresses usable.
IPv4 subnet reference
Below is a table providing typical subnets for IPv4.
| Prefix size | Network mask | Usable hosts per subnet |
|---|---|---|
| /1 | 128.0.0.0 | 2.1B |
| /2 | 192.0.0.0 | 1.1B |
| /3 | 224.0.0.0 | 537M |
| /4 | 240.0.0.0 | 268M |
| /5 | 248.0.0.0 | 134M |
| /6 | 252.0.0.0 | 67.1M |
| /7 | 254.0.0.0 | 33.6M |
| Class A | ||
| /8 | 255.0.0.0 | 16.8M |
| /9 | 255.128.0.0 | 8.4M |
| /10 | 255.192.0.0 | 4.2M |
| /11 | 255.224.0.0 | 2.1M |
| /12 | 255.240.0.0 | 1.0M |
| /13 | 255.248.0.0 | 524K |
| /14 | 255.252.0.0 | 262K |
| /15 | 255.254.0.0 | 131K |
| Class B | ||
| /16 | 255.255.0.0 | 65.5K |
| /17 | 255.255.128.0 | 32.8K |
| /18 | 255.255.192.0 | 16.4K |
| /19 | 255.255.224.0 | 8.2K |
| /20 | 255.255.240.0 | 4.1K |
| /21 | 255.255.248.0 | 2.0K |
| /22 | 255.255.252.0 | 1.0K |
| /23 | 255.255.254.0 | 510 |
| Class C | ||
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
| /31 | 255.255.255.254 | 2 (point-to-point) |
| /32 | 255.255.255.255 | 1 |
Subnet math and the off-by-two
The calculator takes a CIDR prefix and an address and returns the network address, broadcast address, mask and usable host range for IPv4 or IPv6. It works purely on the bit boundaries the prefix defines. Nothing here is inferred from routing or assignment, so the numbers describe the block, not what is actually configured on any device.
The most common source of confusion is the usable host count. In an IPv4 subnet the network and broadcast addresses are not assignable, so a /24 yields 254 usable addresses, not 256. Planning a table of 256 devices against a /24 is how a site ends up two addresses short at the worst possible moment.
Two prefixes break that rule. A /31 is a point-to-point link under RFC 3021 and both addresses are usable, which is standard on router-to-router links. A /32 is a single host route with one address and no broadcast. The reference table below renders a class banner and the matching subnet row from the same fragment, so the two lines are always consistent.
IPv6 has no broadcast address; the all-zeros interface identifier is the subnet-router anycast address, not a host. Watch the larger prefixes especially, since a /64 holds more addresses than any plan will consume, and a /127 point-to-point link is common practice. A frequent planning error is treating the whole block as DHCP space, then discovering the gateway, a virtual IP or a static reservation already sits inside it. Before deploying, confirm the range is not already in use elsewhere in your routing table or an overlapping allocation.
Related reading
- Subnet calculator cheatsheet: CIDR, masks, and host countsA quick-reference for IPv4 subnet math — how to read a CIDR, what the mask actually means, and the easy way to count usable hosts.
- What is my IP address, and why does it matter?Your public IP is the address the rest of the internet uses to talk to you. Here's what it reveals, what it doesn't, and how to check it.
- How to read an open port (and when to actually worry)An 'open port' isn't a vulnerability by itself — it's information. Here's how to tell whether a port being open is fine, suspicious, or actively dangerous, and what to do about each case.