Enter any IP in the subnet
Subnet mask prefix length (0-32)
Embed This Calculator on Your Website
Add this free calculator to your blog, website, or CMS with a simple copy-paste embed code.
Introduction
Network engineers lose hours to manual subnet math. One transposed octet in a production routing table can take down an entire office floor -- and it happens more often than anyone admits. With IPv4 exhaustion forcing ever-tighter CIDR allocations and cloud VPCs demanding precise subnetting for security group isolation, getting the math right is non-negotiable. The IANA IPv4 Address Space Registry documents how address space is carved from /8 superblocks down to individual /32 host routes, and each split requires exact bitwise operations. Whether you are designing a new office network, segmenting a cloud VPC, or preparing for a CCNA exam, this calculator performs all subnet operations instantly: mask derivation, network and broadcast addresses, host ranges, and binary notation -- with no manual bit shifting required.
What This Calculator Does
This IP subnet calculator computes every property of an IPv4 subnet from a single input: address plus CIDR prefix. It outputs the subnet mask in dotted-decimal and binary, the wildcard mask, network address, broadcast address, first and last usable host IPs, total usable host count, IP class (A/B/C/D/E), and whether the address falls in RFC 1918 private space or public routable space. It handles all CIDR prefixes from /0 through /32, including special cases: /31 (RFC 3021 point-to-point) returns 2 usable addresses, /32 (host route) returns 1. It also provides a quick-reference table of common subnets from /24 through /30 for network segmentation planning.
The Formula
The CIDR prefix defines how many bits belong to the network portion. A /24 locks 24 bits for the network, leaving 8 bits for hosts: 2^8 = 256 total addresses, minus 2 reserved (network and broadcast) = 254 usable. The subnet mask is constructed by placing 1s in the first CIDR bit positions and 0s in the remaining host bits -- /24 becomes 11111111.11111111.11111111.00000000 = 255.255.255.0. The network address is found by bitwise AND between the IP and mask. The broadcast address sets all host bits to 1. The wildcard mask (used in Cisco ACLs) is the bitwise inverse of the subnet mask.
Step-by-Step Example
Enter IP address and CIDR prefix
Type 192.168.10.50/26 into the calculator. The /26 tells us 26 bits are network bits, 6 bits are host bits.
Derive the subnet mask
26 ones followed by 6 zeros: 11111111.11111111.11111111.11000000 = 255.255.255.192. The wildcard mask is 0.0.0.63.
Find network and broadcast addresses
Network: 192.168.10.50 AND 255.255.255.192 = 192.168.10.0. Broadcast: set all 6 host bits to 1 = 192.168.10.63. First usable host: 192.168.10.1. Last usable: 192.168.10.62.
Count usable hosts
2^6 = 64 total addresses. Subtract 2 (network + broadcast) = 62 usable host addresses. A /26 fits 62 devices on one subnet.
Real-World Use Cases
Cloud VPC Subnet Design
An AWS VPC starts as a /16 (65,536 IPs). Architects carve it into /24 subnets for each application tier (254 hosts each) and /28 subnets for databases (14 hosts). This calculator confirms there are no overlaps before the Terraform deployment runs, preventing routing conflicts between availability zones.
Office Network Segmentation
A 200-person office needs three VLANs: Staff (120 devices), Guest Wi-Fi (60 devices), and Printers (15 devices). A /25 covers staff (126 usable), a /26 covers guests (62 usable), and a /28 covers printers (14 usable). All three fit cleanly within a 10.10.0.0/24 allocation without overlap.
WAN Point-to-Point Links
Each branch office WAN connection between routers needs exactly 2 IPs. Using /30 wastes 2 addresses (network + broadcast) per link. Switching to /31 (RFC 3021) saves one IP per link -- over 500 branch connections at a large enterprise, that is 500 freed addresses. The calculator confirms /31 yields 2 usable point-to-point addresses on supported platforms.
Comparison
| CIDR Prefix | Subnet Mask | Total Addresses | Usable Hosts | Common Use |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN segment |
| /25 | 255.255.255.128 | 128 | 126 | Half-segment, medium VLAN |
| /26 | 255.255.255.192 | 64 | 62 | Small department VLAN |
| /27 | 255.255.255.224 | 32 | 30 | Small team or server cluster |
| /28 | 255.255.255.240 | 16 | 14 | Database tier, IoT segment |
| /29 | 255.255.255.248 | 8 | 6 | Minimal host group |
| /30 | 255.255.255.252 | 4 | 2 | Traditional P2P WAN link |
| /31 | 255.255.255.254 | 2 | 2 | RFC 3021 P2P link (no broadcast) |
| /32 | 255.255.255.255 | 1 | 1 | Host route, loopback |
Common Mistakes to Avoid
Forgetting to subtract 2 for network and broadcast. A /26 has 64 addresses, but only 62 are assignable. Trying to assign 192.168.10.0 or 192.168.10.63 to a host causes routing failures and IP conflicts.
Assigning the same host IP to two devices because the engineer forgot they already used it in a different subnet range. Always document all assigned IPs in an IPAM tool and cross-reference with the usable host range this calculator provides.
Using /31 on devices that do not support RFC 3021. Older Cisco IOS versions and some network appliances reject /31 point-to-point links. Verify device firmware support before deploying -- the alternative /30 wastes 2 IPs but is universally compatible.
Confusing CIDR notation with subnet mask shorthand. /24 equals 255.255.255.0, not 255.255.255.24. The CIDR number is a bit count, not an address value.
Frequently Asked Questions
What is the difference between a network address and a host address?
The network address is the first IP in a subnet block with all host bits set to 0. It identifies the subnet itself and cannot be assigned to a device. The host range starts at network+1 and ends at broadcast-1. In 10.0.0.0/24, the network address is 10.0.0.0, the host range is 10.0.0.1 to 10.0.0.254, and 10.0.0.255 is the broadcast address.
What are the RFC 1918 private IP address ranges?
RFC 1918 defines three private ranges not routable on the public internet: 10.0.0.0/8 (Class A, 16.7 million addresses), 172.16.0.0/12 (Class B, ~1 million addresses, covering 172.16.x.x through 172.31.x.x), and 192.168.0.0/16 (Class C, 65,536 addresses). All three require NAT for internet connectivity. Cloud providers also use 169.254.0.0/16 (APIPA) for link-local addressing.
How do I subnet a /24 into four equal networks?
Borrow 2 bits from the host portion: /26 gives you four subnets of 64 addresses each (62 usable). The four networks are: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, and 192.168.1.192/26. Each has its own network address, broadcast address, and 62 usable host IPs.
Why does a /32 mask make sense if it only covers one host?
A /32 is a host route: a routing entry pointing to a specific single IP rather than a subnet. It is used for loopback interfaces (127.0.0.1 is always /32), virtual IP addresses (VIPs) on load balancers, and BGP peering addresses. When injected into a routing table, it takes highest precedence due to its specificity.
What is subnetting and why is it done?
Subnetting divides a large IP block into smaller segments to contain broadcast traffic, enforce security boundaries, improve routing efficiency, and match logical network design to physical topology. Without subnetting, a single broadcast from one device reaches every device in the network. A /24 LAN limits that broadcast domain to 254 devices instead of thousands.
Accuracy and Disclaimer
IP subnet calculations use standard bitwise operations on 32-bit IPv4 addresses per RFC 950 and RFC 1812. Results are mathematically exact for IPv4. This tool does not support IPv6 (128-bit) addressing. Always verify subnet designs with your organization's IPAM documentation and change control processes before implementation in production environments. Overlapping subnets cause routing loops and network outages. Consult network architects and follow your organization's change management procedures for any production network modifications.
Conclusion
Subnetting is foundational networking knowledge, but even experienced engineers verify their work with a calculator before committing changes to production. Once your network is correctly segmented, use the Data Transfer Speed Calculator to estimate how bandwidth behaves within each subnet, and the Server Cost of Ownership Calculator to model the infrastructure behind each network segment.
Related Tech & IT Calculators
Data Transfer Speed Calculator
Calculate file transfer time based on file size and connection speed with automatic unit conversion (KB/MB/GB/TB and Mbps/Gbps). Includes overhead adjustment and 2026 typical connection speeds.
Use CalculatorTech & ITServer Cost of Ownership Calculator
Compare on-premises server total cost of ownership (hardware, colocation, power, cooling, maintenance) vs. cloud IaaS over 3 to 5 years with 2026 AWS/Azure/GCP pricing benchmarks.
Use CalculatorTech & ITIT Ticketing Backlog Burn-Down Calculator
Calculate days to clear IT support ticket backlog based on current queue size, daily ticket arrival rate, team resolution capacity, and target resolution SLA for help desk planning.
Use CalculatorTech & ITCloud Infrastructure Cost Estimator
Compare AWS, Azure, and Google Cloud compute instance costs by region, instance type, and workload characteristics with 2026 on-demand and reserved pricing for multi-cloud cost optimization.
Use CalculatorTech & ITLLM API Token Cost Estimator
Estimate monthly token costs using model pricing verified August 19, 2026, including GPT-5.6 Sol, Terra, and Luna; Claude Fable 5, Opus 5, and Sonnet 5; Gemini 3.7 Flash; and custom hosted open-model rates.
Use CalculatorTech & ITVector Database & Embedding Storage Sizer
Size vector database disk storage and planning RAM from current embedding dimensions, quantization, metadata, replicas, and index type, with verified Pinecone, Qdrant, and Zilliz pricing inputs.
Use CalculatorYou May Also Find Useful
Accounts Receivable Aging Calculator
Analyze accounts receivable by aging bucket, calculate Days Sales Outstanding (DSO), Collection Effectiveness Index (CEI), weighted average age, and estimated bad debt exposure using 2026 industry benchmarks.
Use CalculatorAccounting & BookkeepingDepreciation Calculator
Calculate asset depreciation using straight-line, 200% declining balance, or MACRS methods with full year-by-year schedules, 2026 bonus depreciation (20%), and Section 179 references.
Use CalculatorAccounting & BookkeepingCash Flow to Debt Ratio Calculator
Assess business solvency by calculating the cash flow to total debt ratio, debt service coverage ratio (DSCR), free cash flow, and estimated years to repay debt using 2026 lending benchmarks.
Use Calculator