Profession Calculators
Tech & ITPopular

IP Subnet Calculator

Calculate subnet mask, network address, broadcast address, first/last usable host IP, and total usable hosts from CIDR notation (e.g., 192.168.1.0/24) for IPv4 network planning and subnetting.

Share:
Subnet Input

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

Subnet Mask = ~(2^(32-CIDR) - 1) | Network Address = IP AND Subnet Mask | Broadcast Address = Network OR ~Subnet Mask | Usable Hosts = 2^(32-CIDR) - 2 (standard); /31 = 2; /32 = 1

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

1

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.

2

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.

3

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.

4

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 PrefixSubnet MaskTotal AddressesUsable HostsCommon Use
/24255.255.255.0256254Standard LAN segment
/25255.255.255.128128126Half-segment, medium VLAN
/26255.255.255.1926462Small department VLAN
/27255.255.255.2243230Small team or server cluster
/28255.255.255.2401614Database tier, IoT segment
/29255.255.255.24886Minimal host group
/30255.255.255.25242Traditional P2P WAN link
/31255.255.255.25422RFC 3021 P2P link (no broadcast)
/32255.255.255.25511Host 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.