Free Subnet Calculator (With Practice Questions)
Type any IPv4 address with a CIDR prefix or dotted-decimal mask and get the full subnet breakdown instantly — network address, broadcast, usable host range, host count, wildcard mask and a binary view. No sign-up, runs entirely in your browser. Below the tool you'll find worked examples, a head-maths method, and five exam-style practice questions.
Quick answer: A subnet calculator divides an IP network into subnets: given any IPv4 address and CIDR prefix or mask, it returns the network and broadcast addresses, usable host range, host count, and wildcard mask. NetExam Pro's free calculator does this instantly in your browser with no sign-up, and includes worked examples plus five exam-style subnetting practice questions.
Accepted formats: 192.168.1.10/24 or 10.0.0.1 255.255.0.0
How subnetting works (the 30-second version)
A subnet mask splits an IP address into a network portion and a host portion. The /24 in 192.168.1.10/24 means the first 24 bits identify the network and the remaining 8 bits identify hosts on it — giving 28 − 2 = 254 usable addresses. The minus two is because the all-zeros address (network) and all-ones address (broadcast) can never be assigned to a host.
- Network address — the first address in the subnet; identifies the subnet itself, never assigned to a host.
- Broadcast address — the last address; traffic sent here reaches every host in the subnet.
- Usable range — everything between network and broadcast; the addresses you can hand out.
- Wildcard mask — the inverse of the subnet mask, used in ACLs and OSPF network statements.
- Binary view — bold bits are the network portion; this is exactly how routers see your address.
Subnet in your head: the block-size method
You won't have a calculator in the exam room, so learn the block size (sometimes called the magic number): 256 minus the interesting mask octet. For 255.255.255.224, that's 256 − 224 = 32. Subnets then step in multiples of 32: 0, 32, 64, 96, 128, 160, 192, 224. To find which subnet an address sits in, drop to the nearest multiple at or below the interesting octet.
Memorise this table and the method becomes reflex:
| CIDR | Mask (last octet) | Block size | Usable hosts |
|---|---|---|---|
/24 | 0 | 256 | 254 |
/25 | 128 | 128 | 126 |
/26 | 192 | 64 | 62 |
/27 | 224 | 32 | 30 |
/28 | 240 | 16 | 14 |
/29 | 248 | 8 | 6 |
/30 | 252 | 4 | 2 |
For a printable one-pager of CIDR, masks, wildcards and binary, grab our CIDR cheat sheet.
Worked examples
Six examples covering the question types that actually appear on the exam. Try each one yourself first, then check with the calculator above.
1. Which subnet does 192.168.10.77/26 belong to, and what is its broadcast address?
Block size = 256 − 192 = 64. Subnets step in 64s: 0, 64, 128, 192. 77 falls between 64 and 128, so the subnet is 192.168.10.64/26. Broadcast = network + block size − 1 = 64 + 64 − 1 = 192.168.10.127. Usable range: .65 – .126 (62 hosts).
2. You need a subnet for 50 hosts. What is the smallest mask that fits?
You need 2n − 2 ≥ 50. A /27 gives only 30 usable — too small. A /26 gives 62 usable, so /26 (255.255.255.192) is the answer. Always pick the first mask whose usable count reaches your requirement.
3. VLSM: carve subnets for 50, 25, 10 and 5 hosts out of 192.168.20.0/24.
Allocate largest first to avoid stranded addresses. 50 hosts → /26: 192.168.20.0/26 (.0–.63). 25 hosts → /27: 192.168.20.64/27 (.64–.95). 10 hosts → /28: 192.168.20.96/28 (.96–.111). 5 hosts → /29: 192.168.20.112/29 (.112–.119). Everything from .120 upward is still free.
4. Summarise these four networks with a single route: 10.1.0.0/24, 10.1.1.0/24, 10.1.2.0/24, 10.1.3.0/24.
Four contiguous /24s aligned on a multiple of 4 → shorten the mask by 2 bits: 10.1.0.0/22. Check: /22 covers 10.1.0.0–10.1.3.255 — nothing extra, nothing missing. Each doubling of subnets shortens the mask by one more bit.
5. A point-to-point link between two routers needs 2 usable addresses. Which mask?
/30 (255.255.255.252): 4 total addresses, 2 usable. A /31 (RFC 3021) also works on point-to-point links with zero waste, but /30 is the safe exam answer unless /31 is explicitly offered.
6. What are the network and broadcast addresses for 172.16.5.4/20?
The interesting octet is the third: mask 255.255.240.0, block size = 256 − 240 = 16. Third-octet subnets step in 16s: 0, 16, 32… 5 falls in the 0 block, so network = 172.16.0.0/20, broadcast = 172.16.15.255. The fourth octet spans the full 0–255 range.
Quick-fire practice questions
Five exam-style questions. Answer from memory (or head-maths), then click to reveal — and verify with the calculator.
Q1. How many usable hosts does a /28 provide?
14. A /28 has 4 host bits: 24 − 2 = 14. Block size 16 (256 − 240).
Q2. 10.20.30.200/27 — what is the broadcast address?
10.20.30.223. Block size 32; subnets step 0, 32, 64 … 192, 224. 200 sits in the 192 subnet (10.20.30.192/27); broadcast = 192 + 32 − 1 = 223.
Q3. What is the wildcard mask for 255.255.255.224?
0.0.0.31. Wildcard = 255.255.255.255 minus the subnet mask, octet by octet. You'll use this in ACLs and OSPF network statements.
Q4. Which mask gives the smallest subnet that fits 100 hosts?
/25 (255.255.255.128). A /26 gives 62 usable — too small. A /25 gives 126 usable, the first that fits 100.
Q5. Is 192.168.1.63 a usable host address in 192.168.1.64/26?
No — and it's not in that subnet at all. 192.168.1.64/26 spans .64–.127. The .63 address is the broadcast of the previous subnet (192.168.1.0/26). A classic exam trap.
Subnetting for the CCNA 200-301 exam
Subnetting questions show up in Network Fundamentals and across troubleshooting scenarios. The exam expects you to work out masks, ranges and host counts quickly — often without a calculator. Drill the block sizes until /25 = 126, /26 = 62, /27 = 30, /28 = 14, /29 = 6 and /30 = 2 hosts are reflex, then test yourself against the clock with our subnetting drill and subnetting practice questions.
For the full topic with key exam points, see our CCNA subnetting cheat sheet. Prefer drills to reading? The binary–decimal converter is the fastest way to build the binary fluency subnetting rewards.
More free tools: Subnetting drill CIDR cheat sheet Binary–decimal converter Flashcards
Ready to test yourself?
Subnetting is one topic of six on the CCNA 200-301. Take the free 25-question mock test — no sign-up — and find out where you stand. One subscription (£5/month or £39/year) unlocks all 370 exam-style questions, 20 in-browser labs and 300 flashcards across all 10 certifications.
Start the free mock test →