Subnet Calculator
Quick CIDR Reference
| CIDR | Subnet Mask | Usable Hosts | Total Addresses |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | 16,777,216 |
| /16 | 255.255.0.0 | 65,534 | 65,536 |
| /20 | 255.255.240.0 | 4,094 | 4,096 |
| /24 | 255.255.255.0 | 254 | 256 |
| /25 | 255.255.255.128 | 126 | 128 |
| /26 | 255.255.255.192 | 62 | 64 |
| /27 | 255.255.255.224 | 30 | 32 |
| /28 | 255.255.255.240 | 14 | 16 |
| /29 | 255.255.255.248 | 6 | 8 |
| /30 | 255.255.255.252 | 2 | 4 |
Frequently Asked Questions
What is a subnet mask?
A subnet mask is a 32-bit number that divides an IP address into network and host portions:
- The network portion identifies which network the device belongs to
- The host portion identifies the specific device on that network
- Subnet masks use consecutive 1s followed by consecutive 0s in binary
- Common masks include 255.255.255.0 (/24), 255.255.0.0 (/16), and 255.0.0.0 (/8)
For example, with a /24 subnet mask, the first 24 bits identify the network and the last 8 bits identify hosts.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation is a compact way to specify IP addresses and their associated subnet masks:
- Written as IP address followed by a slash and the number of network bits (e.g., 192.168.1.0/24)
- The number after the slash indicates how many bits are used for the network portion
- /24 means the first 24 bits are the network part (255.255.255.0)
- /16 means the first 16 bits are the network part (255.255.0.0)
- Larger CIDR numbers mean smaller networks with fewer hosts
CIDR replaced the older classful addressing system and allows more flexible allocation of IP addresses.
What are IP address classes?
IP address classes are a legacy classification system based on the first octet of an IP address:
- Class A (1-126): Large networks with up to 16 million hosts. Default mask: /8
- Class B (128-191): Medium networks with up to 65,534 hosts. Default mask: /16
- Class C (192-223): Small networks with up to 254 hosts. Default mask: /24
- Class D (224-239): Reserved for multicast groups
- Class E (240-255): Reserved for experimental use
Note: 127.x.x.x is reserved for loopback addresses (localhost).
What is the difference between network and broadcast addresses?
Network and broadcast addresses are special addresses in every subnet that cannot be assigned to hosts:
- Network Address: The first address in a subnet, with all host bits set to 0. It identifies the subnet itself.
- Broadcast Address: The last address in a subnet, with all host bits set to 1. Messages sent here reach all hosts in the subnet.
- These two addresses reduce usable hosts by 2 in each subnet
- For 192.168.1.0/24: network is 192.168.1.0, broadcast is 192.168.1.255
Usable host addresses are everything between the network and broadcast addresses.
What is a wildcard mask?
A wildcard mask is the inverse of a subnet mask, commonly used in access control lists (ACLs) and routing protocols:
- Calculated by subtracting each subnet mask octet from 255
- For subnet mask 255.255.255.0, wildcard is 0.0.0.255
- 0 bits in wildcard mean "must match exactly"
- 1 bits in wildcard mean "can be any value"
- Used extensively in Cisco IOS for ACLs and OSPF configuration
Think of it as: subnet mask defines the network, wildcard mask defines what can vary.