Subnet / CIDR Calculator
Calculate network details from an IP address and CIDR prefix. Get network address, broadcast, host range, subnet mask, wildcard mask, and more.
Enter an IP with CIDR notation (e.g. 10.0.0.0/8) or type an IP and pick a prefix from the dropdown.
Common CIDR Notations
| CIDR | Subnet Mask | Wildcard | Total IPs | Usable Hosts | Notes |
|---|
Understanding Subnetting and CIDR
What is CIDR Notation?
CIDR (Classless Inter-Domain Routing) notation is a compact way to express
an IP address and its associated network mask. It is written as an IP address followed by a
slash and a number, e.g. 192.168.1.0/24. The number after the slash is the
prefix length -- the count of leading 1-bits in the subnet mask. A /24 prefix
means the first 24 bits identify the network, leaving 8 bits for host addresses (256 IPs, 254
usable hosts).
Subnet Mask vs. Wildcard Mask
A subnet mask like 255.255.255.0 uses 1-bits to mark the
network portion and 0-bits for the host portion. The wildcard mask is the
bitwise inverse -- 0.0.0.255 for a /24. Wildcard masks are used in access
control lists (ACLs) on Cisco routers and in OSPF configurations. Where the subnet mask says
"must match," the wildcard mask says "don't care."
Network and Broadcast Addresses
The network address is the first IP in a subnet (all host bits set to 0). It identifies the subnet itself and cannot be assigned to a host. The broadcast address is the last IP (all host bits set to 1) and is used to send packets to every host on the subnet. The usable host range falls between these two addresses. For a /31, RFC 3021 allows both addresses to be used for point-to-point links.
IP Address Classes
Before CIDR, IPs were divided into classes:
- Class A (
1.0.0.0--126.255.255.255): /8 default mask, large networks - Class B (
128.0.0.0--191.255.255.255): /16 default mask, medium networks - Class C (
192.0.0.0--223.255.255.255): /24 default mask, small networks - Class D (
224.0.0.0--239.255.255.255): Multicast - Class E (
240.0.0.0--255.255.255.255): Reserved/experimental
Private IP Ranges (RFC 1918)
Three IPv4 address blocks are reserved for private networks and are not routable on the public internet:
10.0.0.0/8-- 16,777,216 addresses (Class A private)172.16.0.0/12-- 1,048,576 addresses (Class B private)192.168.0.0/16-- 65,536 addresses (Class C private)
These ranges are used in home networks, corporate LANs, and behind NAT gateways. Additional
special ranges include 127.0.0.0/8 (loopback), 169.254.0.0/16
(link-local / APIPA), and 100.64.0.0/10 (CGN / shared address space).
Why Subnetting Matters
Subnetting lets you divide a large network into smaller, more manageable segments. Benefits include:
- Security -- isolate departments or services into separate subnets
- Performance -- reduce broadcast domain size, lowering noise
- Efficient IP usage -- allocate only as many addresses as needed (e.g. /30 for point-to-point links)
- Routing -- CIDR enables route aggregation (supernetting), shrinking routing tables
Understanding subnetting is fundamental for network design, cloud VPC planning (AWS, GCP, Azure), Kubernetes pod networking, Docker bridge networks, and firewall rule configuration.
What is Subnet Calculation?
Subnet calculation is the process of dividing a larger IP network into smaller, more manageable sub-networks (subnets). Every IP address consists of two parts: the network portion that identifies which network the device belongs to, and the host portion that identifies the specific device within that network. The subnet mask determines where this boundary falls.
When you enter a CIDR notation like 192.168.1.0/24 into this calculator, it computes the network address, broadcast address, usable host range, subnet mask, and wildcard mask. These values are essential for configuring routers, firewalls, DHCP servers, and cloud VPCs (AWS, GCP, Azure). Network engineers use subnet calculators daily to plan IP address allocation, troubleshoot connectivity issues, and design efficient network architectures.
Modern networks rely on CIDR (Classless Inter-Domain Routing) instead of the older classful addressing system. CIDR allows flexible allocation of IP addresses by using variable-length subnet masks (VLSM), which reduces IP address waste and enables route aggregation (supernetting) to keep routing tables small.
CIDR Subnet Reference Table
| CIDR | Subnet Mask | Usable 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 |
| /31 | 255.255.255.254 | 2 (RFC 3021) |
| /32 | 255.255.255.255 | 1 (single host) |
Frequently Asked Questions
What is CIDR notation and how does it work?
CIDR (Classless Inter-Domain Routing) notation is a compact way to represent an IP address and its subnet mask. It is written as an IP address followed by a slash and a prefix length, for example 192.168.1.0/24. The prefix length indicates how many leading bits of the address identify the network. A /24 means 24 network bits and 8 host bits, giving 256 total addresses (254 usable hosts).
How do I calculate the number of hosts in a subnet?
The formula is 2^(32 - prefix length) - 2 for usable hosts. You subtract 2 because the first address is the network address and the last is the broadcast address. For example, a /24 subnet has 2^8 - 2 = 254 usable hosts. Exceptions: /31 subnets allow 2 usable hosts (RFC 3021), and /32 represents a single host.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask uses 1-bits to mark the network portion and 0-bits for the host portion (e.g. 255.255.255.0 for /24). A wildcard mask is the bitwise inverse -- it uses 0-bits for the network and 1-bits for the host portion (e.g. 0.0.0.255 for /24). Wildcard masks are commonly used in Cisco ACLs and OSPF configurations.
What are the private IP address ranges?
RFC 1918 defines three private IPv4 ranges: 10.0.0.0/8 (16.7 million addresses), 172.16.0.0/12 (1 million addresses), and 192.168.0.0/16 (65,536 addresses). These addresses are not routable on the public internet and are used in home networks, corporate LANs, and behind NAT gateways.
What is the difference between /24, /16, and /8 subnets?
A /24 subnet has a mask of 255.255.255.0 and provides 254 usable hosts -- the most common subnet for small networks. A /16 has a mask of 255.255.0.0 with 65,534 usable hosts, suitable for medium-sized networks. A /8 has a mask of 255.0.0.0 with over 16 million usable hosts, used for very large networks. The smaller the prefix number, the larger the network.