Subnet calculator
Enter an IPv4 address and a CIDR prefix to get the network and broadcast addresses, the usable host range, subnet and wildcard masks, and the host count — instantly. Free, no signup.
CIDR cheat sheet
The prefixes you'll meet most on Network+, A+, and CCNA.
| CIDR | Subnet mask | Wildcard | Usable hosts |
|---|---|---|---|
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,382 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,094 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 |
The block-size method in 20 seconds
You don't need binary once the mask octets are memorized — 128, 192, 224, 240, 248, 252, 254, 255. Every subnet question becomes arithmetic:
- Find the block size: subtract the interesting mask octet from 256. For /26 (192): 256 − 192 = 64.
- Step in blocks: subnets start at 0, 64, 128, 192. Your address falls in the block at or below it → that's the network.
- Broadcast: one below the next block. For 192.168.1.130 /26 → network 192.168.1.128, broadcast 192.168.1.191.
Want to get fast at this? Drill it under a timer until it's reflex.
Subnetting is one Network+ objective
The N10-009 exam has five domains. Take the free 25-question diagnostic to see where you actually stand — and get a daily plan built from your weak spots.
Take the free diagnosticNot ready to sign up? Try the free Network+ practice test — no account needed.
Frequently asked questions
How do I calculate a subnet by hand?
Use the block-size (magic number) method. Find the interesting mask octet (the one that isn't 0 or 255), subtract it from 256 to get the block size, and the subnets step by that block: 0, block, 2×block… Your address falls in the block at or below it — that's the network address, and the broadcast is one below the next block. For /26 (mask 255.255.255.192): 256 − 192 = 64, so 192.168.1.130 sits in the .128 block → network 192.168.1.128, broadcast 192.168.1.191.
How many usable hosts are in a /26?
62. Host bits are 32 − 26 = 6, so 2^6 = 64 total addresses, minus the network and broadcast addresses = 62 usable. The same math gives 254 for a /24, 30 for a /27, and 2 for a /30 (the classic point-to-point link).
What is a wildcard mask?
The bitwise inverse of the subnet mask — where the mask has 1s, the wildcard has 0s. A /24 mask of 255.255.255.0 has a wildcard of 0.0.0.255. Cisco ACLs and OSPF network statements use wildcard masks instead of subnet masks, so it's worth being able to flip between them.
What's the difference between a /31 and a /30?
A /30 has 4 addresses: network, two usable hosts, and broadcast — the traditional point-to-point link. A /31 (RFC 3021) drops the network/broadcast distinction so both addresses are usable, saving an address on point-to-point links. This calculator counts a /31 as 2 usable hosts with no broadcast.
Is this subnet calculator free?
Yes — unlimited, no account. If you're studying for Network+ or A+, a free CertBench account adds timed subnetting drills, the full question bank with spaced repetition, and a readiness score across every exam domain.