Subnet Calculator
Calculate subnet details for any IPv4 or IPv6 address. Enter an IP and CIDR prefix to instantly get network address, broadcast address, usable host range, wildcard mask, and total hosts. Includes full CIDR reference table and binary breakdown.
Tip: Press "." to advance to next octet. Paste a full IP or CIDR (e.g. 10.0.0.0/8).
Address Details
Network boundaries and host range
Subnet Masks
Mask representations for this subnet
Binary & Hex
Machine-level representations
CIDR Reference Table
Common IPv4 CIDR prefixes
| CIDR | Subnet Mask | Total | Usable |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
How Subnet Calculation Works
Understanding the math behind IP subnetting
Subnetting divides a network into smaller segments by borrowing bits from the host portion of an IP address. The subnet mask tells routers which bits are the network portion and which are the host portion.
For example, 192.168.1.130/24: the mask is 255.255.255.0 (24 bits of 1s). Performing 192.168.1.130 AND 255.255.255.0 gives the network address 192.168.1.0. The broadcast address is 192.168.1.255, and usable hosts range from .1 to .254 (254 hosts).
Understanding CIDR Notation
Classless Inter-Domain Routing explained
CIDR notation (e.g., 192.168.1.0/24) combines an IP address with its prefix length. The prefix number indicates how many leading bits form the network portion.
| CIDR | Mask | Hosts | Use Case |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | Large ISP / Class A |
| /16 | 255.255.0.0 | 65,534 | Enterprise / Class B |
| /24 | 255.255.255.0 | 254 | Standard LAN |
| /27 | 255.255.255.224 | 30 | Small office |
| /30 | 255.255.255.252 | 2 | Point-to-point link |
| /32 | 255.255.255.255 | 1 | Single host route |
CIDR replaced the older classful addressing system (Class A/B/C), enabling more efficient IP allocation. Instead of fixed /8, /16, or /24 boundaries, networks can be any prefix length from /0 to /32.
Common Subnet Sizes and Use Cases
Choosing the right subnet for your network
/24 — Standard Network
254 usable hosts. The most common subnet for home networks, small offices, and VLANs. Provides enough addresses for a typical department.
/16 — Enterprise Network
65,534 usable hosts. Used in large enterprise networks or campus environments. Provides a wide address range for segmentation with further subnetting.
/30 and /31 — Point-to-Point
/30 provides 2 usable hosts (traditional router-to-router). /31 (RFC 3021) uses both addresses without a broadcast — ideal for modern point-to-point links.
/28 — Small Server VLAN
14 usable hosts. Perfect for a DMZ, management VLAN, or a small group of servers where you want tight address control and minimal broadcast domain.
Common Subnetting Mistakes
Avoid these frequent errors in subnet planning
Forgetting to subtract network & broadcast
A /24 has 256 total addresses but only 254 usable hosts. The first address is the network address and the last is the broadcast address — neither can be assigned to a device.
Confusing subnet mask with wildcard mask
A subnet mask (255.255.255.0) and wildcard mask (0.0.0.255) are bitwise inverses. Subnet masks are used in IP configuration, while wildcards are used in Cisco ACLs and OSPF.
Oversizing the subnet
Using a /16 (65,534 hosts) when you need 50 hosts wastes address space. A /26 (62 hosts) is far more appropriate. Right-sizing subnets improves security and reduces broadcast traffic.
Ignoring reserved ranges
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are private (RFC 1918) — not routable on the public internet. 127.0.0.0/8 is loopback and 169.254.0.0/16 is link-local (APIPA).
Frequently Asked Questions
Common questions about IP subnetting and subnet masks