IP Subnet Calculator
Common Subnet Sizes
| CIDR | Mask | Hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 |
| /16 | 255.255.0.0 | 65,534 |
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
IP Address Classes
Private IP Ranges
Related Tools
Understanding IP Subnetting
What is Subnetting?
Subnetting is the practice of dividing a network into smaller, more manageable subnetworks (subnets). This allows for better organization, improved security, and more efficient use of IP addresses. Each subnet has its own range of IP addresses and can operate as an independent network segment.
Key Subnet Components
CIDR Notation
Classless Inter-Domain Routing (CIDR) notation represents the subnet mask as a suffix indicating the number of network bits. For example, /24 means 24 bits for the network portion, leaving 8 bits for hosts.
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
How Subnet Calculation Works
Example: 192.168.1.100/24
Binary Math Behind Subnetting
Subnet calculations use bitwise operations. The network address is found by performing a bitwise AND between the IP and subnet mask. The broadcast address is found by OR-ing the network address with the inverted mask (wildcard mask).
Network Address
Broadcast Address
Why Usable Hosts = Total - 2?
In each subnet, two addresses are reserved:
Network Address
The first address (all host bits = 0) identifies the network itself. It cannot be assigned to a device.
Broadcast Address
The last address (all host bits = 1) is used to send messages to all hosts on the network simultaneously.
Special Subnets
Practical Applications
IPv4 vs IPv6
This calculator is for IPv4 addresses (32-bit). IPv6 uses 128-bit addresses with different notation and subnetting concepts. IPv6 subnets are typically /64, providing 2^64 addresses per subnet.
Frequently Asked Questions
What does CIDR notation like /24 mean?
CIDR notation indicates how many bits are used for the network portion. /24 means 24 network bits and 8 host bits, giving 256 total addresses (254 usable). /24 equals subnet mask 255.255.255.0.
How many usable hosts are in a subnet?
Total hosts = 2^(host bits) - 2. We subtract 2 for network address and broadcast address. A /24 has 2^8 - 2 = 254 usable hosts. A /30 has 2^2 - 2 = 2 usable hosts (common for point-to-point links).
What is the difference between subnet mask and wildcard mask?
Subnet mask has 1s for network bits (255.255.255.0). Wildcard mask is the inverse with 1s for host bits (0.0.0.255). Wildcard masks are used in access control lists (ACLs) and routing protocols like OSPF.
What are private IP address ranges?
Private IPs are not routable on the internet: 10.0.0.0/8 (Class A), 172.16.0.0/12 (Class B), 192.168.0.0/16 (Class C). Most home networks use 192.168.x.x. These addresses can be reused in different private networks.