Subnetting Basics: How IP Address Ranges Work
What a subnet is, how CIDR notation works, and how to calculate network addresses — no prior experience required.
What is an IP Address?
An IPv4 address is a 32-bit number that uniquely identifies a device on a network. We write it
as four groups of 0–255 separated by dots — for example, 192.168.1.50. Each group
is called an octet because it represents 8 bits of the address.
You do not need to work in binary to manage subnets day-to-day, but understanding that every address has exactly 32 bits is the key to everything that follows.
What is a Subnet?
A subnet (short for subnetwork) is a contiguous range of IP addresses treated as a single logical network. All devices within a subnet can communicate directly with each other without needing a router.
Dividing a large address block into smaller subnets lets you:
- Keep different parts of your business (office floor, CCTV, guest Wi-Fi) on separate networks for security
- Limit broadcast traffic so networks stay performant as they grow
- Apply firewall rules at a network boundary rather than on every device
CIDR Notation
You will see IP addresses written with a forward slash and a number: 192.168.1.0/24.
The number after the slash is the prefix length — it tells you how many of the
32 bits identify the network, with the rest identifying individual hosts within it.
| Notation | Network bits | Host bits | Total addresses | Usable hosts |
|---|---|---|---|---|
| /24 | 24 | 8 | 256 | 254 |
| /25 | 25 | 7 | 128 | 126 |
| /26 | 26 | 6 | 64 | 62 |
| /27 | 27 | 5 | 32 | 30 |
| /28 | 28 | 4 | 16 | 14 |
| /30 | 30 | 2 | 4 | 2 |
The formula is: usable hosts = 2^(host bits) − 2. You subtract 2 because the first address is the network address and the last is the broadcast address — neither can be assigned to a device.
A Worked Example: 192.168.1.0/24
Take the subnet 192.168.1.0/24:
- Network address:
192.168.1.0— identifies the subnet itself. Cannot be used by a device. - Broadcast address:
192.168.1.255— a packet sent here reaches every device on the subnet. Cannot be used by a device. - Usable range:
192.168.1.1through192.168.1.254— 254 addresses you can assign. - Subnet mask:
255.255.255.0— the traditional way to express /24. The 255s mark network bits; the 0 marks host bits.
Thinking in Blocks
Each time you increase the prefix length by 1, you halve the number of addresses. Going from /24 to /25 splits the 256-address block into two 128-address halves:
192.168.1.0/24 splits into: ├── 192.168.1.0/25 (hosts .1 – .126) └── 192.168.1.128/25 (hosts .129 – .254)
This is the foundation of subnetting — choosing the prefix length that fits your requirements, and splitting larger blocks into smaller ones as needed. The article on VLSM covers how to do this efficiently when segments need different sizes.
The Subnet Mask
Older equipment and some documentation use a subnet mask instead of CIDR notation. They are two ways of saying the same thing:
| CIDR | Subnet mask |
|---|---|
| /24 | 255.255.255.0 |
| /25 | 255.255.255.128 |
| /26 | 255.255.255.192 |
| /27 | 255.255.255.224 |
| /16 | 255.255.0.0 |
| /8 | 255.0.0.0 |
CIDR is almost universally used in modern networking because it is more compact. If you see a subnet mask, just count the consecutive 255s to get an approximate prefix length — or use the subnet calculator to convert.
Quick Reference
- Smaller prefix number → bigger subnet, more addresses (
/8has 16 million) - Larger prefix number → smaller subnet, fewer addresses (
/30has 4) /32is a single individual IP address — the smallest possible subnet/0represents every IP address — the entire internet
Try the subnet calculator
Enter any CIDR range to see its network address, broadcast, usable hosts, and more.
Open calculator