Subnet and CIDR Calculator
Calculate subnet masks, network addresses, broadcast addresses, and host ranges from CIDR notation. Essential tool for network planning and troubleshooting.
Subnetting is one of those skills that seems needlessly complex the first time you encounter it, and then clicks completely once you understand what problem it's solving. Breaking a large network into smaller subnets lets you control broadcast traffic, apply different security policies, and organize devices logically. The CalcHub Subnet Calculator handles all the bit-math so you can focus on the planning.
What the Calculator Gives You
Enter any IP address in CIDR notation (like 192.168.10.0/24) and get:
- Network address — the base address of the subnet
- Broadcast address — the last address, reserved for broadcast traffic
- Subnet mask — in dotted decimal (255.255.255.0) and hex
- Wildcard mask — inverse of subnet mask, used in ACLs
- First/last usable host — actual range you can assign to devices
- Number of usable hosts
- IP class and whether it's private or public
CIDR Quick Reference
| CIDR | Subnet Mask | Hosts | Typical Use |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | Large ISP or enterprise |
| /16 | 255.255.0.0 | 65,534 | Campus network |
| /24 | 255.255.255.0 | 254 | Office LAN |
| /25 | 255.255.255.128 | 126 | Split office LAN |
| /28 | 255.255.255.240 | 14 | Small server cluster |
| /30 | 255.255.255.252 | 2 | Point-to-point link |
| /31 | 255.255.255.254 | 2 (no broadcast) | Router-to-router (RFC 3021) |
| /32 | 255.255.255.255 | 1 | Host route / loopback |
Practical Example: Planning an Office Network
Your company has 192.168.0.0/16 assigned. You need separate subnets for:
- Staff desktops (max 200 devices)
- Servers (max 20 devices)
- Guest WiFi (max 100 devices)
- Printers (max 15 devices)
- Management/network gear (max 10 devices)
Running through the calculator:
| Department | Subnet | Mask | Hosts Available |
|---|---|---|---|
| Staff | 192.168.1.0/24 | /24 | 254 |
| Servers | 192.168.2.0/27 | /27 | 30 |
| Guest WiFi | 192.168.3.0/25 | /25 | 126 |
| Printers | 192.168.4.0/28 | /28 | 14 |
| Management | 192.168.5.0/28 | /28 | 14 |
IPv4 vs IPv6 Support
The calculator handles both IPv4 and IPv6. IPv6 subnets follow the same logic but with 128-bit addresses. A /64 IPv6 subnet (the standard allocation for a single LAN) has 2⁶⁴ addresses — enough that you could give a unique address to every atom in several cups of water. For IPv6, the calculator also shows the subnet's EUI-64 range and link-local prefix.
Tips
- Always document your subnets. Use the calculator's export function to generate a spreadsheet of your allocation plan before you start configuring switches and routers.
- Leave room to grow. If you have 50 devices today, allocate a /25 (126 hosts) not a /26 (62 hosts). Renumbering a subnet later is painful.
- VLANs and subnets aren't the same thing. A VLAN is a Layer 2 concept; a subnet is Layer 3. They're often paired 1:1, but understanding the distinction matters for routing.
What's the difference between a subnet mask and a CIDR prefix?
They're two ways of expressing the same thing. A /24 prefix means the first 24 bits are the network portion — equivalent to a 255.255.255.0 subnet mask. CIDR notation is more compact and is used in routing tables.
Can I subnet a public IP block?
Yes. If your ISP assigns you 203.0.113.0/29 (6 usable addresses), you can allocate individual IPs as /32 host routes or sub-allocate the block. The rules are the same as private addressing.
What does "variable length subnet masking" (VLSM) mean?
VLSM means using different prefix lengths in different parts of your network — /24 for a large LAN, /30 for WAN links. Modern IP networks all use VLSM; classful networking (where all subnets in a network had the same mask) was deprecated with the introduction of CIDR.
Related Calculators
- IP Converter Calculator — convert between binary, decimal, and hex IP formats
- VLAN Calculator — plan VLAN assignments alongside subnets
- Network Uptime Calculator — SLA planning after infrastructure design