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
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 CalculatorYou May Also Find Useful
Tax Calculator
Estimate your 2026 federal income tax based on filing status, gross income, deductions, and current tax brackets. See your marginal and effective tax rates instantly.
Use CalculatorFinance & AccountingSalary to Hourly Calculator
Convert your annual salary to an hourly wage instantly. Adjust for hours per week, weeks per year, and overtime to find your true hourly rate.
Use CalculatorFinance & AccountingCommission Calculator
Determine sales commissions based on revenue, rate tiers, and bonus structures.
Use Calculator