Subnet CIDR Calculator Tool
How to Calculate Subnets (IPv4 Subnetting Step-by-Step)
Subnetting means dividing one big network into smaller sub-networks (subnets).
Most common exam question types:
• How many subnets can I create?
• How many hosts per subnet?
• What are the subnet addresses / broadcast addresses / usable range?
• How many subnets can I create?
• How many hosts per subnet?
• What are the subnet addresses / broadcast addresses / usable range?
Key Formulas You Must Memorize
Number of subnets = 2ⁿ where n = number of bits borrowed from host part
Number of hosts per subnet = 2ʰ − 2 where h = remaining host bits
(we subtract 2 because network address and broadcast address are not usable)
Fast Reference Table – Class C (/24) Most Common
| Subnet Mask | CIDR | Bits borrowed | Number of subnets | Usable hosts per subnet | Increment (block size) |
|---|---|---|---|---|---|
| 255.255.255.128 | /25 | 1 | 2 | 126 | 128 |
| 255.255.255.192 | /26 | 2 | 4 | 62 | 64 |
| 255.255.255.224 | /27 | 3 | 8 | 30 | 32 |
| 255.255.255.240 | /28 | 4 | 16 | 14 | 16 |
| 255.255.255.248 | /29 | 5 | 32 | 6 | 8 |
| 255.255.255.252 | /30 | 6 | 64 | 2 | 4 |
Step-by-Step Example
Question: You have network
You need at least 5 subnets with as many hosts as possible in each subnet.
Step 1: How many bits do we need to borrow?
2² = 4 subnets → too few
2³ = 8 subnets → enough (we borrow 3 bits)
Step 2: New subnet mask = /24 + 3 = /27
Subnet mask = 255.255.255.224
Step 3: Block size (increment) = 256 − 224 = 32
Step 4: Subnet ranges:
192.168.10.0/24.You need at least 5 subnets with as many hosts as possible in each subnet.
Step 1: How many bits do we need to borrow?
2² = 4 subnets → too few
2³ = 8 subnets → enough (we borrow 3 bits)
Step 2: New subnet mask = /24 + 3 = /27
Subnet mask = 255.255.255.224
Step 3: Block size (increment) = 256 − 224 = 32
Step 4: Subnet ranges:
- 192.168.10.0 – 192.168.10.31 (/27)
- 192.168.10.32 – 192.168.10.63
- 192.168.10.64 – 192.168.10.95
- 192.168.10.96 – 192.168.10.127
- 192.168.10.128 – 192.168.10.159
- 192.168.10.160 – 192.168.10.191
- 192.168.10.192 – 192.168.10.223
- 192.168.10.224 – 192.168.10.255
Quick Cheat Method (most used in exams)
- Write down original network + mask (example: 172.16.0.0 /16)
- Decide how many subnets OR how many hosts you need
- Find the smallest power of 2 that satisfies the requirement
- Calculate new /CIDR → new mask
- Calculate block size: 256 − last octet of mask
- Add block size repeatedly to find each subnet address
Practice with different class B and class C networks — after ~10 examples it becomes automatic!