Subnet Calculator
Calculate subnet masks, CIDR ranges, host counts, and network boundaries.
What is a Subnet Calculator?
A subnet calculator takes an IP address and CIDR prefix length (e.g. 192.168.1.0/24) and computes everything derived from that block: network address, broadcast address, subnet mask, usable host range, wildcard mask, and total host count. It removes the error-prone manual binary arithmetic that network engineers used to do on paper.
Subnetting is the practice of dividing a larger IP address space into smaller logical segments. Each subnet is an independent broadcast domain. Proper subnetting controls traffic flow, limits blast radius during incidents, satisfies security zone requirements, and makes IP address management (IPAM) tractable at scale.
CIDR Reference Table
| CIDR | Subnet Mask | Usable Hosts | Network Addresses | Common Use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | Class A | Large ISP blocks |
| /16 | 255.255.0.0 | 65,534 | Class B | Campus networks |
| /24 | 255.255.255.0 | 254 | Class C | Standard LAN |
| /25 | 255.255.255.128 | 126 | Half /24 | Split department LANs |
| /26 | 255.255.255.192 | 62 | Quarter /24 | Small offices |
| /27 | 255.255.255.224 | 30 | Eighth /24 | Server segments |
| /28 | 255.255.255.240 | 14 | 16-host block | DMZ segments |
| /29 | 255.255.255.248 | 6 | 8-host block | Point-to-point WAN |
| /30 | 255.255.255.252 | 2 | 4-host block | Router links |
| /31 | 255.255.255.254 | 2 (no broadcast) | RFC 3021 links | Router-to-router |
| /32 | 255.255.255.255 | 1 (host route) | Single host | Loopback, firewall rules |
Key Terms Explained
Network address — The first address in the subnet. Never assigned to a host. For 192.168.1.0/24, the network address is 192.168.1.0.
Broadcast address — The last address in the subnet. Packets sent here reach all hosts in the subnet. For 192.168.1.0/24, broadcast is 192.168.1.255.
Usable hosts — Total addresses minus network and broadcast. A /24 has 256 addresses; 254 are usable.
Subnet mask — A 32-bit value that separates the network portion from the host portion. /24 equals 255.255.255.0 in dotted decimal.
Wildcard mask — The inverse of the subnet mask. Used in ACLs and OSPF area definitions. /24 wildcard = 0.0.0.255.
CIDR notation — Classless Inter-Domain Routing. Replaces the old Class A/B/C system. The /n suffix specifies how many bits are the network portion.
Worked Example: 10.0.0.0/22
| Property | Value |
|---|---|
| Network address | 10.0.0.0 |
| Broadcast address | 10.0.3.255 |
| Subnet mask | 255.255.252.0 |
| Wildcard mask | 0.0.3.255 |
| First usable host | 10.0.0.1 |
| Last usable host | 10.0.3.254 |
| Total usable hosts | 1,022 |
| Addresses in block | 1,024 |
Private IP Address Ranges (RFC 1918)
| Range | CIDR | Hosts Available |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,214 |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,574 |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,534 |
These ranges are not routed on the public internet. Any traffic destined for these addresses from a public network is dropped at border routers.
CLI Commands
# ipcalc (Linux — most distros)
ipcalc 192.168.1.0/24
# Python — manual subnet calculation
python3 -c "import ipaddress; n=ipaddress.ip_network('10.0.0.0/22'); print(f'Hosts: {n.num_addresses-2}, Broadcast: {n.broadcast_address}')"
# ip command — list local subnets
ip route show
# Show all interfaces with CIDR
ip addr show | grep "inet "
# Verify a host is in a subnet
python3 -c "import ipaddress; print('192.168.1.50' in ipaddress.ip_network('192.168.1.0/24'))"
Common Subnetting Mistakes
Overlapping subnets — Two subnets sharing address space will cause routing ambiguity. Always check that new subnets don't overlap existing allocations before deploying.
Forgetting the network and broadcast — A /30 gives 4 addresses total but only 2 usable hosts. A /29 gives 8 addresses, 6 usable. Miscount this and you'll run out of addresses mid-rollout.
Using /24 everywhere — Fine for small deployments but wastes address space and creates flat networks. Segment by function: separate subnets for servers, workstations, printers, IoT, and guests.
Supernetting errors — When summarising routes, the summary prefix must exactly cover the target subnets. Use the calculator to verify before advertising summary routes.
Frequently Asked Questions
Q: What is the difference between /24 and /25? A: A /24 provides 254 usable hosts. A /25 splits that into two subnets of 126 usable hosts each. The /25 has one additional bit allocated to the network portion, halving the host space.
Q: How many hosts does a /27 support? A: A /27 has 32 total addresses. Subtract the network and broadcast addresses and you get 30 usable hosts.
Q: Can I use /31 or /32 subnets? A: /31 is valid for point-to-point links between routers (RFC 3021) — it has two addresses and no broadcast. /32 is a host route identifying a single device, commonly used for loopbacks and firewall rules.
Q: What does CIDR stand for? A: Classless Inter-Domain Routing. It replaced the rigid Class A/B/C system in 1993 and allowed flexible allocation of IP address space, which made the modern internet scale possible.
Q: How do I subnet a /24 into four equal parts?
A: Use /26. Four /26 subnets fit in a /24, each providing 62 usable hosts: x.x.x.0/26, x.x.x.64/26, x.x.x.128/26, x.x.x.192/26.
Related Tools
- IP Geolocation Lookup — locate an IP address geographically
- Ping — test reachability within a subnet
- Reverse DNS Lookup — map IPs to hostnames
- Online Traceroute — trace routing paths across subnets
Operational intent and scope
Subnet Calculator is designed for practical troubleshooting where you need fast evidence, clear next actions, and shareable results. The tool focuses on subnet calculator workflows and gives operators enough signal to decide whether the issue is likely local, resolver-level, provider-level, or configuration-level.
In production, this matters because teams usually lose time in handoffs. One team runs a quick check, another team needs context, and the result is re-tested from scratch. This page avoids that loop by combining an executable widget, interpretation guidance, and route-level SEO content that stays visible to both users and crawlers.
Inputs, outputs, and decision quality
- Primary input: TEXT
- Primary output: structured findings that map directly to remediation decisions
- Best use moment: migrations, incidents, change windows, verification after rollout
When reading output, do not treat a single result as absolute truth. Network controls, DNS cache variance, provider policy, and browser fetch constraints can all affect one-time checks. The reliable method is:
- Run Subnet Calculator to establish first signal.
- Cross-check with one related tool.
- Confirm final state against authoritative provider logs or telemetry.
That model is intentionally reflected in this page structure so operational teams can move from signal to proof quickly.
Interpretation framework
Use this compact framework during triage:
- Expected output usually means the current configuration is aligned.
- Missing output often indicates invalid input, resolver delay, or absent record/state.
- Unexpected output frequently points to stale caches, aliasing conflicts, policy mismatch, or partial rollouts.
- Intermittent output is common during propagation windows or regional provider differences.
A good practice is to capture a timestamped snapshot of the output and re-check at a fixed interval. This creates an evidence trail and helps explain why symptoms changed over time.
Common failure patterns for Subnet Calculator
- Input normalization issues: malformed domain/IP/URL values silently reduce result quality.
- Cross-environment drift: staging and production values diverge after rushed changes.
- Assumed global consistency: teams test from one region and assume all resolvers/providers match.
- Missing post-change validation: updates are made, but no verification pass is executed.
Preventive control is straightforward: standardize input, run a baseline before change, compare after change, and store both outputs in tickets or runbooks.
Workflow pairing and escalation path
Subnet Calculator is strongest when paired with adjacent checks. Recommended next tools in this cluster: IP Geolocation Lookup, Port Scanner, Ping, MAC Address Lookup.
Escalate to deeper analysis when:
- The same input returns conflicting results across repeated runs.
- Results indicate policy or trust-chain issues that require provider-side logs.
- A security-sensitive check shows ambiguous outcomes.
- Incident scope crosses DNS, email, and transport boundaries simultaneously.
Quick remediation checklist
- Validate exact TEXT value before running.
- Run the check and record output with timestamp.
- Compare against expected production baseline.
- Re-test after a controlled interval.
- Cross-check using related tools.
- Apply configuration changes only after confirming root cause.
FAQ highlights used by teams
- What does this tool check? — This tool provides a focused diagnostic signal with interpretation guidance.
- Why can results vary? — Resolver cache, provider policy, and regional path differences can change observed results.
- Can I share this check? — Yes. URL query state can be shared for reproducible team handoffs.
- Is this enough for production closure? — Use as first-pass diagnostics, then verify with authoritative provider logs.
Why this page is built this way
This page is intentionally implemented as a tool-plus-article format so it works for both execution and discoverability. The first fold keeps action visible, and the supporting sections provide structured guidance that remains indexable in prerendered HTML. That approach reduces repeat incidents, shortens handoff cycles, and improves long-tail search relevance without sacrificing technical clarity.
Incident checklist for Subnet Calculator
When subnet calculator becomes part of an active incident, keep decisions narrow and evidence-based. Start with one precise hypothesis, run the check, and log output with timestamp and input value. If output is ambiguous, re-run from the same page and compare with at least one related tool.
During escalation, avoid changing multiple variables at once. Apply one change, rerun diagnostics, and capture the delta. This gives teams a defensible change history and makes rollback safer if impact widens.
Change-window verification pattern
Use Subnet Calculator before, during, and after planned changes. A pre-change baseline identifies current expected behavior. During-change checks reveal transient variance. Post-change checks confirm final state and eliminate assumptions.
For teams managing approvals, attach these outputs to tickets to reduce review cycles. This page is intentionally structured to support that workflow without requiring context from private dashboards.
| Signal | Meaning | Action |
|---|---|---|
| Expected result | Configuration likely aligned | Document and monitor baseline |
| Unexpected result | Potential config drift | Cross-check related tools |
| No result | Input/resolver/policy issue | Validate input and retry |
| Intermittent response | Regional/cache variance | Re-run across time window |
| Error | Endpoint or network blocked | Verify source setup and access policy |