IPv4 Subnet Calculator
What is Subnetting?
Subnetting is the practice of dividing a single large computer network into smaller, manageable pieces (subnets). It prevents network congestion by limiting the size of the "Broadcast Domain."
Think of it like zip codes. If the entire world shared one list of mailing addresses, the post office would be chaotic. By breaking areas into Zip Codes (Subnets), traffic can be routed efficiently.
Understanding CIDR Notation (The "/24")
You often see IPs written like 192.168.1.5/24. What does the "/24" mean?
This is CIDR (Classless Inter-Domain Routing) notation. An IPv4 address is 32 bits long. The CIDR number tells you how many of those bits are "Frozen" to identify the Network.
/24 Mask: 11111111.11111111.11111111.00000000
• 24 bits are Network (Frozen)
• 8 bits are Hosts (Available for devices)
In a /24 network, the first 3 octets (192.168.1) match for everyone. Only the last octet (1-254) changes for each computer.
Network vs. Broadcast Address
When you calculate a subnet range, two addresses are always reserved and cannot be assigned to a specific computer.
- Network Address (First): This identifies the subnet itself (e.g., 192.168.1.0).
- Broadcast Address (Last): Used to shout "Hello" to every device on that specific subnet (e.g., 192.168.1.255).
This is why the formula for "Usable Hosts" is always Total IPs - 2.
Subnet Cheat Sheet
Here are the most common subnet masks used in networking.
| CIDR | Subnet Mask | Total IPs | Usable Hosts |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 (Host Route) |
| /30 | 255.255.255.252 | 4 | 2 (Point-to-Point) |
| /24 | 255.255.255.0 | 256 | 254 (Standard LAN) |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /8 | 255.0.0.0 | 16 Million | ~16 Million |
Private vs. Public IPs
You cannot use just any IP address. Certain ranges are reserved for "Private" use (LANs) and do not work on the public internet. These are defined by RFC 1918:
- 10.0.0.0 to 10.255.255.255 (Large Business networks)
- 172.16.0.0 to 172.31.255.255 (AWS/Cloud often use this)
- 192.168.0.0 to 192.168.255.255 (Home Routers)