Subnetting & CIDR Explained
Subnetting splits a network into smaller ones. Once you see the network/host split, CIDR and subnet masks stop being magic.
The idea
An IPv4 address is 32 bits. Subnetting chooses how many of those bits identify the network and how many identify the host within it. That split is written in CIDR notation: 192.168.1.0/24.
Compute any of this with the free subnet calculator.
Network bits vs host bits
192.168.1.0/24→ 24 network bits, 8 host bits.10.0.0.0/8→ 8 network bits, 24 host bits.
More network bits mean fewer hosts per subnet and more subnets.
CIDR to mask
| CIDR | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /30 | 255.255.255.252 | 4 | 2 |
Usable hosts = 2^(host bits) − 2 (network and broadcast addresses are reserved).
A worked example
Split 192.168.1.0/24 into four equal subnets using /26:
| Subnet | Range | Usable |
|---|---|---|
| 192.168.1.0/26 | .0 – .63 | .1 – .62 |
| 192.168.1.64/26 | .64 – .127 | .65 – .126 |
| 192.168.1.128/26 | .128 – .191 | .129 – .190 |
| 192.168.1.192/26 | .192 – .255 | .193 – .254 |
Each subnet has its own network and broadcast address.
Why subnetting matters
- Organisation — separate teams, floors or VLANs.
- Performance — smaller broadcast domains.
- Security — segment sensitive systems.
- Address efficiency — allocate exactly what you need.
Private ranges to remember
10.0.0.0/8172.16.0.0/12192.168.0.0/16
These are not routable on the public internet. Check the class of any address with the IP address checker.
Beyond IPv4
IPv6 uses 128-bit addresses and a different structure, but the CIDR concept is identical. See the IPv6 calculator.
Practise
Enter any address and prefix into the subnet calculator to see the mask, range and host count instantly.