Subnet Calculator
Calculate network details, host ranges, and subnet masks from any IP/CIDR.
Input
Quick Examples
Results
| IP Address | — |
| CIDR Notation | — |
| Network Address | — |
| Broadcast Address | — |
| Subnet Mask | — |
| Wildcard Mask | — |
| First Usable Host | — |
| Last Usable Host | — |
| Total Addresses | — |
| Usable Hosts | — |
| IP Class | — |
| IP Type | — |
Binary Representation
Common Subnet Reference
| CIDR | Mask | Hosts | Usable |
|---|
What is a subnet mask?
A subnet mask is a 32-bit number that tells a computer which part of an IP address is the "network" portion and which part is the "host" portion. It's the same length as an IPv4 address (4 octets, written in dotted decimal) and works by being AND-ed bitwise with the IP.
Example: IP 192.168.1.42 with subnet mask 255.255.255.0
- Network portion:
192.168.1.0(the first three octets) - Host portion:
.42(the last octet) - All devices in this subnet share the network portion; only the host portion differs.
In binary, 255.255.255.0 is 11111111.11111111.11111111.00000000 — 24 ones followed by 8 zeros. The ones are the network part, the zeros are the host part. This is what CIDR notation shortens: /24 = "24 bits of network". It's the same information in fewer characters.
Subnet mask cheat sheet
Every subnet size from the most common to the rarest, with usable-host counts:
| CIDR | Subnet mask | Total IPs | Usable hosts | Wildcard mask | Typical use |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | 0.255.255.255 | Class A, ISP allocation, 10.0.0.0/8 private |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | 0.15.255.255 | 172.16.0.0/12 private range |
| /16 | 255.255.0.0 | 65,536 | 65,534 | 0.0.255.255 | Class B, 192.168.0.0/16 private, AWS VPC default |
| /20 | 255.255.240.0 | 4,096 | 4,094 | 0.0.15.255 | Medium VPC subnet |
| /22 | 255.255.252.0 | 1,024 | 1,022 | 0.0.3.255 | Small enterprise LAN |
| /23 | 255.255.254.0 | 512 | 510 | 0.0.1.255 | Slash-23 subnet |
| /24 | 255.255.255.0 | 256 | 254 | 0.0.0.255 | Class C, the default LAN. 192.168.1.0/24, etc. |
| /25 | 255.255.255.128 | 128 | 126 | 0.0.0.127 | Half a /24, splitting a LAN |
| /26 | 255.255.255.192 | 64 | 62 | 0.0.0.63 | AWS/Azure subnet division |
| /27 | 255.255.255.224 | 32 | 30 | 0.0.0.31 | Small office segment |
| /28 | 255.255.255.240 | 16 | 14 | 0.0.0.15 | Very small LAN |
| /29 | 255.255.255.248 | 8 | 6 | 0.0.0.7 | Point-to-point extended |
| /30 | 255.255.255.252 | 4 | 2 | 0.0.0.3 | Point-to-point link (router-to-router) |
| /31 | 255.255.255.254 | 2 | 2 | 0.0.0.1 | RFC 3021 point-to-point (no network/broadcast) |
| /32 | 255.255.255.255 | 1 | 1 | 0.0.0.0 | Single host (firewall rules, ACL entries) |
Usable hosts = total IPs - 2 (one network address, one broadcast address are reserved). Exception: /31 and /32 per RFC 3021 don't reserve.
Designing an AWS VPC or Azure VNet subnet layout
Cloud VPCs use the same CIDR math as physical networks. Common design pattern for a /16 VPC (65,536 addresses):
- Split into /20 subnets — gives 16 subnets of 4,094 usable hosts each. Plenty of room.
- Use separate /24 subnets per AZ + tier — e.g. us-east-1a public (/24), us-east-1a private (/24), us-east-1b public (/24), us-east-1b private (/24)… 256 IPs each is usually more than enough for dozens of EC2 instances.
- Reserve first /24 for management — bastion host, VPN gateway, NAT gateway, load balancer endpoints.
- Avoid /28 or smaller — AWS reserves 5 IPs per subnet (network, VPC router, DNS, future use, broadcast). A /28 gives only 11 usable, not 14.
Plug your CIDR into the calculator above to see the exact network/broadcast/wildcard values you'll need for route tables, NACLs and security group source filters.
Frequently Asked Questions
How do I calculate a subnet or CIDR online?
Enter an IP with CIDR notation (e.g. `192.168.1.0/24`) or classful mask. The calculator returns network address, broadcast address, usable host range, subnet mask, wildcard mask, and total hosts. Essential for network design, firewall rules and VPC setup.
What is CIDR notation (e.g. /24, /16, /8)?
CIDR (Classless Inter-Domain Routing) writes a subnet mask as the number of leading 1-bits. `/24` = 255.255.255.0 (256 addresses). `/16` = 255.255.0.0 (65,536). `/8` = 255.0.0.0 (16.7M). Each step halves or doubles the subnet size.
How many hosts can a /24 or /27 subnet hold?
Total addresses in `/24` = 256, but 2 are reserved (network, broadcast) leaving 254 usable hosts. `/27` = 32 total, 30 usable. `/29` = 8 total, 6 usable. Our calculator shows exact counts for any CIDR.
What's a wildcard mask in ACLs (Cisco, ACL)?
The wildcard is the subnet mask inverted: `/24` (255.255.255.0) becomes `0.0.0.255`. Cisco ACLs match IPs with wildcards instead of masks. Our calculator shows both so you can write ACL rules without the mental flip.
How do I subnet an AWS VPC or Azure VNet CIDR?
Pick a parent CIDR (e.g. `10.0.0.0/16`), split into subnets by increasing the prefix (`/20` = 16 subnets of 4094 hosts, `/24` = 256 subnets of 254 hosts). Our tool shows every possible split — useful when designing private/public subnet layouts.
Copyright © 2026 BuildStudio. All rights reserved.
Designed and Developed by Webority Technologies