IP Subnet Calculator
Calculate subnet mask, network address, broadcast, wildcard mask, and usable host ranges from any IPv4 address and CIDR prefix.
Reference table
| IP Address — Octet 1 | CIDR Notation | Network Address | Broadcast Address |
|---|---|---|---|
| 1 | 1.168.1.0 /24 | 1.168.1.0 | 1.168.1.255 |
| 2 | 2.168.1.0 /24 | 2.168.1.0 | 2.168.1.255 |
| 3 | 3.168.1.0 /24 | 3.168.1.0 | 3.168.1.255 |
| 4 | 4.168.1.0 /24 | 4.168.1.0 | 4.168.1.255 |
| 5 | 5.168.1.0 /24 | 5.168.1.0 | 5.168.1.255 |
| 10 | 10.168.1.0 /24 | 10.168.1.0 | 10.168.1.255 |
| 15 | 15.168.1.0 /24 | 15.168.1.0 | 15.168.1.255 |
| 20 | 20.168.1.0 /24 | 20.168.1.0 | 20.168.1.255 |
| 25 | 25.168.1.0 /24 | 25.168.1.0 | 25.168.1.255 |
| 30 | 30.168.1.0 /24 | 30.168.1.0 | 30.168.1.255 |
| 40 | 40.168.1.0 /24 | 40.168.1.0 | 40.168.1.255 |
| 50 | 50.168.1.0 /24 | 50.168.1.0 | 50.168.1.255 |
| 60 | 60.168.1.0 /24 | 60.168.1.0 | 60.168.1.255 |
| 70 | 70.168.1.0 /24 | 70.168.1.0 | 70.168.1.255 |
| 75 | 75.168.1.0 /24 | 75.168.1.0 | 75.168.1.255 |
Subnetting Tips
- Use /24 (254 hosts) for home or small office networks — most common subnet size.
- Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — free for internal use.
- First IP = network ID, last IP = broadcast — neither can be assigned to a device.
- AWS/Azure reserve 3–5 extra IPs per subnet — always use the cloud provider mode for accurate counts.
What Is Subnetting?
How CIDR Notation Works
Key Subnetting Concepts
- Network address: the first address in a subnet — identifies the network itself and cannot be assigned to any host.
- Broadcast address: the last address — sends packets to every host on that subnet simultaneously.
- Wildcard mask: the bitwise inverse of the subnet mask — used in Cisco ACLs and OSPF routing configurations.
- Plan for growth: if you need 50 hosts today, /26 (62 usable) leaves little room — consider /25 (126 usable) instead.
- RFC 1918 private ranges are not routable on the public internet — NAT translates them to public IPs for external access.
- Over-subnetting wastes addresses: each subnet loses 2 IPs (network + broadcast), so many tiny subnets add up.
Common Subnet Sizes
- /32 — Single Host: Used for loopback addresses and host routes in routing tables.
- /30 — 2 Hosts: Standard for point-to-point links between routers (also see /31 per RFC 3021).
- /28 — 14 Hosts: Small server room, a few printers, or an IoT VLAN.
- /24 — 254 Hosts: The most common subnet for homes, small offices, and individual VLANs.
- /20 — 4,094 Hosts: Medium enterprise — an entire building floor or large department.
- /16 — 65,534 Hosts: Large campus or data center; often the size of a full Class B allocation.
Subnetting Examples
Step-by-step subnet calculations
Example: 192.168.1.100 /24
- IP: 192.168.1.100 → Binary: 11000000.10101000.00000001.01100100
- CIDR /24 → Mask: 255.255.255.0 → Binary: 11111111.11111111.11111111.00000000
- AND operation: Network = 192.168.1.0 (first 24 bits match, last 8 zeroed)
- Host bits = 32 − 24 = 8 → Total addresses = 2⁸ = 256
- Usable hosts = 256 − 2 = 254
- First usable: 192.168.1.1 | Last usable: 192.168.1.254 | Broadcast: 192.168.1.255
192.168.1.0/24 supports 254 devices. Wildcard: 0.0.0.255
Example: AWS VPC 10.0.0.0 /24
- IP: 10.0.0.0/24 → 256 total addresses
- Standard: 256 − 2 = 254 usable hosts
- AWS reserves 5 IPs: .0 (network), .1 (VPC router), .2 (DNS), .3 (future), .255 (broadcast)
- AWS usable: 256 − 5 = 251 hosts
- First usable: 10.0.0.4 | Last usable: 10.0.0.254
- Azure: same 251 hosts | GCP: 252 hosts (4 reserved)
Always use cloud provider mode for accurate host counts in AWS/Azure/GCP.
Frequently Asked Questions
What is a subnet mask and why is it important?
A subnet mask is a 32-bit number that divides an IP address into the network portion and the host portion. It tells routers and devices which part of the IP address identifies the network and which part identifies individual devices. Without a subnet mask, devices cannot determine if a destination IP is on the same local network or needs to be forwarded through a router. The most common subnet mask is 255.255.255.0 (/24), which creates a network with 254 usable host addresses.
How do AWS, Azure, and GCP differ in reserved IPs per subnet?
Cloud providers reserve extra IP addresses beyond the standard network and broadcast addresses. AWS reserves 5 IPs per subnet: the network address (.0), the VPC router (.1), the DNS server (.2), reserved for future use (.3), and the broadcast address. Azure also reserves 5 IPs with a similar pattern. Google Cloud reserves 4 IPs: the network address, default gateway, broadcast, and one for DHCP. This means a /24 subnet gives you 254 hosts on standard networks, but only 251 on AWS/Azure or 252 on GCP.
What is CIDR notation and how does it relate to subnet masks?
CIDR (Classless Inter-Domain Routing) notation uses a slash followed by a number to indicate how many bits form the network prefix. For example, /24 means 24 bits are the network portion, equivalent to the subnet mask 255.255.255.0. CIDR replaced the old classful system (Class A, B, C) to allow more flexible address allocation. The formula is simple: total addresses = 2^(32 − prefix_length), and usable hosts = total addresses − 2 (subtracting the network and broadcast addresses).
What is a wildcard mask and when is it used?
A wildcard mask is the bitwise inverse of a subnet mask. Where a subnet mask has 1s, the wildcard mask has 0s, and vice versa. For example, if the subnet mask is 255.255.255.0, the wildcard mask is 0.0.0.255. Wildcard masks are primarily used in Cisco router ACLs (Access Control Lists) and OSPF routing configurations to specify which bits of an address should be matched. A wildcard mask of 0.0.0.255 means 'match the first three octets exactly, allow any value in the last octet.'
What is the difference between /30 and /31 subnets?
A /30 subnet provides 4 total addresses with 2 usable hosts — traditionally used for point-to-point links between routers. A /31 subnet (defined in RFC 3021) provides exactly 2 addresses with no network or broadcast address, making both IPs usable for point-to-point links. While /31 is more efficient (saves one IP), not all older network equipment supports it. Modern routers and most cloud providers fully support /31 for router-to-router connections.
How do I choose the right subnet size for my network?
Start by counting the number of devices that need IP addresses, then add 20–50% for growth. Use the formula: find the smallest CIDR prefix where 2^(32−prefix) − 2 ≥ your host count. For example, 50 devices need at least a /26 (62 usable), but a /25 (126 usable) provides room to grow. For cloud deployments, remember to account for the extra reserved IPs. For home networks, /24 (254 hosts) is almost always sufficient. For router links, use /30 or /31.