
Subnet Calculator Guide — CIDR, Subnet Masks & IP Ranges Explained
📷 Brett Sayles / PexelsSubnet Calculator Guide — CIDR, Subnet Masks & IP Ranges Explained
Everything you need to know about CIDR notation, subnet masks, and IP address ranges. Use the free online subnet calculator to instantly compute network addresses, broadcast addresses, and host counts.
If you have ever stared at a subnet mask and felt a mild sense of dread, you are not alone. IP addressing and subnetting sit at one of those awkward intersections — theory-heavy enough to be confusing, but practical enough that you really cannot avoid it in networking, DevOps, or cloud infrastructure work.
This guide cuts through the jargon. By the end you will understand what CIDR notation actually means, how to read subnet calculator output without second-guessing yourself, and a few real-world scenarios where getting this right really matters. You can also punch your numbers into our free Subnet Calculator and skip the manual arithmetic entirely — but understanding the underlying logic will make you a much better debugger when things go sideways.
What Is CIDR Notation?
CIDR stands for Classless Inter-Domain Routing. Before CIDR became the standard in the 1990s, IP address allocation was split into rigid "classes" — Class A, B, and C — which wasted enormous blocks of addresses. CIDR replaced that with a flexible prefix system.
When you see something like 192.168.1.0/24, the part after the slash is the prefix length. It tells you how many of the 32 bits in an IPv4 address are reserved for the network. The remaining bits belong to the host.
/24means 24 network bits, 8 host bits/16means 16 network bits, 16 host bits/8means 8 network bits, 24 host bits
The smaller the prefix number, the larger the network. A /8 is enormous (over 16 million hosts). A /30 is tiny (just 2 usable hosts — perfect for a point-to-point link).
Subnet Masks: The Same Information, Different Format
A subnet mask is just CIDR notation written out in full dotted-decimal. The two formats carry identical information:
| CIDR | Subnet Mask |
|---|---|
| /8 | 255.0.0.0 |
| /16 | 255.255.0.0 |
| /24 | 255.255.255.0 |
| /25 | 255.255.255.128 |
| /30 | 255.255.255.252 |
The mask works by lining up with your IP address in binary. Every bit position where the mask has a 1 is part of the network; every position with a 0 is available for hosts. That is why 255.255.255.0 means "lock in the first three octets, leave the last one free" — which gives you 256 possible values in the last octet (0–255).
Reading Subnet Calculator Output
When you plug an address into a subnet calculator, you get back several key pieces of information. Here is what each one means:
Network Address
This is the "first" address in the subnet and identifies the network itself. It is never assigned to a host. For 192.168.1.50/24, the network address is 192.168.1.0.
Broadcast Address
The last address in the subnet, used to send traffic to every device on the network simultaneously. For 192.168.1.0/24, the broadcast address is 192.168.1.255. It is also never assigned to a host.
Usable Host Range
All addresses between the network address and broadcast address. For /24, that is 192.168.1.1 through 192.168.1.254 — 254 hosts.
Host Count
The total number of assignable IP addresses. The formula is 2^(32 - prefix) - 2. The minus 2 accounts for the network and broadcast addresses.
Wildcard Mask The bitwise inverse of the subnet mask. We will talk more about this below.
Private vs. Public IP Ranges
Not all IP addresses are equal. RFC 1918 defined three address blocks specifically for private networks — ranges that are not routed on the public internet:
10.0.0.0/8— the largest private range, commonly used in large enterprises and cloud VPCs172.16.0.0/12— covers172.16.0.0to172.31.255.255192.168.0.0/16— the one most people recognize from home routers
If you are designing an internal network, you should always use one of these ranges. Using a public IP block as your internal range is a common beginner mistake that causes routing headaches the moment your traffic tries to reach the actual owner of that public block.
One other range worth knowing: 127.0.0.0/8 is the loopback range. 127.0.0.1 (localhost) lives here. Traffic sent to any address in this block never leaves the machine.
Practical Examples
Let us walk through three real-world scenarios that cover the most common prefix lengths you will encounter.
Small Office Network — /24
A classic /24 (192.168.1.0/24) is the default for almost every home and small office network for a reason: it is simple and provides plenty of capacity.
- Network address: 192.168.1.0
- Broadcast: 192.168.1.255
- Usable hosts: 192.168.1.1 – 192.168.1.254 (254 hosts)
- Subnet mask: 255.255.255.0
254 devices is more than enough for most small offices. Typical practice is to reserve a block near the bottom (say .1 through .10) for infrastructure — router, switches, access points, servers — and let DHCP hand out the rest dynamically.
Data Center Subnet — /22
When you need more hosts, you expand the prefix. A /22 gives you four times the space of a /24.
- Network address: 10.0.0.0
- Broadcast: 10.0.3.255
- Usable hosts: 10.0.0.1 – 10.0.3.254 (1,022 hosts)
- Subnet mask: 255.255.252.0
Notice how the network spans across what look like four /24 subnets (10.0.0.x through 10.0.3.x). That is because the prefix is 22 bits rather than 24, freeing up 2 extra bits in the third octet (2^2 = 4 blocks).
This size is popular in cloud environments where you are allocating a subnet for a team or an application tier inside a VPC.
Point-to-Point Link — /30
A /30 is the classic choice for connecting two routers directly. You only ever have two endpoints, so you only need two usable addresses.
- Network address: 10.1.0.0
- Broadcast: 10.1.0.3
- Usable hosts: 10.1.0.1 and 10.1.0.2 (exactly 2 hosts)
- Subnet mask: 255.255.255.252
Every ISP uplink, every BGP peering session, every WAN connection between routers — this is your subnet. Allocating a /24 here would waste 252 addresses for no benefit.
Binary Representation: Why It Actually Matters
Most subnet calculators (including ours) will show you the binary representation of the subnet mask and host range. It is tempting to skip past this, but binary is where subnetting actually makes sense.
Take 255.255.255.0 in binary:
11111111.11111111.11111111.00000000
Those first 24 ones are the network bits. The 8 zeros are host bits. Now you can see exactly why you get 256 addresses (2^8) and why the subnet boundary always falls on multiples of 256 when the prefix is a multiple of 8.
What about a /25?
11111111.11111111.11111111.10000000
That single extra network bit splits the /24 in half. You now have two /25 subnets:
192.168.1.0/25(hosts .1–.126, broadcast .127)192.168.1.128/25(hosts .129–.254, broadcast .255)
This is the core skill in subnetting: knowing how prefix length shifts change the number of networks and hosts available. Binary makes it visual.
The Wildcard Mask — Cisco and OSPF
If you work with Cisco routers or configure OSPF/BGP routing protocols, you will encounter wildcard masks. A wildcard mask is simply the bitwise complement of the subnet mask.
| Subnet Mask | Wildcard Mask |
|---|---|
| 255.255.255.0 | 0.0.0.255 |
| 255.255.255.252 | 0.0.0.3 |
| 255.255.0.0 | 0.0.255.255 |
In a Cisco ACL (Access Control List), the wildcard mask tells the router which bits must match. A 0 bit means "this bit must match exactly." A 1 bit means "this bit can be anything."
So permit ip 192.168.1.0 0.0.0.255 means: allow any IP address where the first three octets are 192.168.1 (the last octet can be anything from 0 to 255). That is equivalent to permitting the entire 192.168.1.0/24 network.
Our subnet calculator outputs the wildcard mask alongside the subnet mask so you can copy it directly into your router config without doing the mental inversion yourself.
Common Edge Cases and Mistakes
The /32 — A Single Host
A /32 is technically a subnet with exactly one address. There are no host bits, so there is no range — the network address, the host address, and the broadcast address are all the same thing.
You will see /32 routes used in routing tables to create a "host route" — a static route that points to a single specific IP. BGP uses them frequently for advertising individual server IPs. They are also used in firewall rules to match a single exact address.
The /31 — The Special Case
By traditional rules, /31 subnets seemed useless because 2 total addresses minus 2 (network + broadcast) leaves zero usable hosts. RFC 3021 changed that for point-to-point links: it defined /31 as valid for two-router connections where both endpoints are used as host addresses and there is no broadcast address.
Modern Cisco and Juniper gear support /31 links. It is slightly more efficient than /30 because it wastes one less address per link. In a large ISP with thousands of point-to-point connections, that adds up.
Misaligned Network Addresses
A common mistake is specifying a host address where a network address is expected. If your subnet is 192.168.1.0/24, the network address must end in .0 — not .50 or .100. Some tools silently correct this (they mask the address with the subnet mask to find the true network address). Others throw an error. Our calculator shows you both the entered address and the corrected network address so you can see exactly what is happening.
Overlapping Subnets
When building out a network plan with multiple subnets, it is easy to accidentally create overlapping ranges. For example, 192.168.1.0/24 and 192.168.0.0/22 overlap because the /22 already contains the entire /24. Routers will behave unpredictably when they have overlapping routes, so always verify your allocations before deploying.
Putting It All Together
Subnetting is one of those skills that clicks suddenly after feeling opaque for a while. The key insight is that a subnet is just a contiguous block of IP addresses defined by fixing a certain number of leading bits. The prefix length tells you how many bits are fixed. Binary makes it concrete.
When you are planning a network — whether it is a VPC in AWS, a data center floor plan, or a home lab — start with your largest subnets first and work down. Identify how many hosts each segment needs, add some growth headroom (doubling your estimate is a reasonable rule of thumb), and pick the smallest prefix that fits. This keeps your IP space organized and makes routing cleaner.
For quick calculations, try the Subnet Calculator on ToolBox Hub. Enter any IP address and prefix length and you will instantly see the network address, broadcast address, host range, total host count, subnet mask, and wildcard mask — no mental arithmetic required. It also shows the binary representations, which is genuinely useful when you are teaching the concepts or debugging an unexpected routing behavior.
Happy networking.