IP Subnet Calculator — Free Online CIDR Calculator
Subnet calculation is one of the most error-prone tasks in network engineering. A single mistake in your subnet mask can leave hosts unreachable, security zones misconfigured, or entire network segments overlapping. Our free IP Subnet Calculator computes network address, broadcast address, first/last usable hosts, subnet mask, wildcard mask, IP class, and usable host count — instantly from any IPv4 + CIDR prefix combination.
What Is Subnetting?
Subnetting is the practice of dividing a larger IP network into smaller, more manageable sub-networks (subnets). Each subnet is a contiguous block of IP addresses defined by a network address and a subnet mask (or its CIDR prefix notation).
Subnetting is used to:
- Reduce network congestion by limiting broadcast domains
- Improve security by isolating departments or services into separate network segments
- Optimize IP address allocation by assigning only as many addresses as needed
- Enable network topology design for VLANs, DMZs, VPNs, and cloud VPCs
CIDR Notation Explained
CIDR (Classless Inter-Domain Routing) notation expresses a network as an IP address followed by a slash and a prefix length: 192.168.1.0/24.
The prefix length (the number after the slash) indicates how many leading bits of the IP address are fixed (the network portion). The remaining bits define the host portion of the address.
| CIDR | Subnet Mask | Network Bits | Host Bits | Total Addresses | Usable Hosts |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 8 | 24 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 16 | 16 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 24 | 8 | 256 | 254 |
| /25 | 255.255.255.128 | 25 | 7 | 128 | 126 |
| /26 | 255.255.255.192 | 26 | 6 | 64 | 62 |
| /27 | 255.255.255.224 | 27 | 5 | 32 | 30 |
| /28 | 255.255.255.240 | 28 | 4 | 16 | 14 |
| /29 | 255.255.255.248 | 29 | 3 | 8 | 6 |
| /30 | 255.255.255.252 | 30 | 2 | 4 | 2 |
| /32 | 255.255.255.255 | 32 | 0 | 1 | 1 (loopback/host route) |
How to Use the Subnet Calculator
- Enter an IPv4 address like
192.168.1.100in the IP Address field - Select a CIDR prefix from the dropdown (shows accurate usable host counts)
- Click Calculate
- All subnet details appear immediately in the results grid
The calculator runs entirely in your browser — no API calls, no server processing.
What the Calculator Computes
Example: 192.168.1.100/24
| Field | Value | How It’s Calculated |
|---|---|---|
| Network Address | 192.168.1.0/24 | IP AND subnet mask |
| Broadcast Address | 192.168.1.255 | Network address OR inverted mask |
| First Host | 192.168.1.1 | Network address + 1 |
| Last Host | 192.168.1.254 | Broadcast address − 1 |
| Total Addresses | 256 | 2^(32−prefix) = 2^8 |
| Usable Hosts | 254 | Total − 2 (network + broadcast) |
| Subnet Mask | 255.255.255.0 | 32 bits: 24 ones + 8 zeros |
| Wildcard Mask | 0.0.0.255 | Inverse of subnet mask |
| IP Class | C | First octet 192 falls in Class C range |
Understanding the Results
Network Address
The network address is the first address in the subnet. It represents the subnet itself and cannot be assigned to any host. In routing tables, the network address identifies the subnet.
Broadcast Address
The broadcast address is the last address in the subnet. Packets sent to the broadcast address are delivered to all hosts in the subnet. It cannot be assigned as a host address.
Usable Hosts
Usable hosts = Total addresses − 2. The two reserved addresses (network and broadcast) are subtracted. Exception: /31 subnets used for point-to-point links include both addresses as assignable (RFC 3021); /32 is a host route.
Subnet Mask vs. Wildcard Mask
- Subnet mask: Used by routers and hosts to determine which part of an IP address is the network portion. Binary 1s = network, 0s = host.
- Wildcard mask: The bitwise inverse of the subnet mask. Used in ACL (Access Control List) rules in Cisco IOS and Junos. Where the subnet mask is
255.255.255.0, the wildcard is0.0.0.255.
Private IP Address Ranges
When designing internal networks, use these IANA-reserved private address spaces:
| Range | CIDR Notation | Typical Use |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | Large enterprise networks |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | Medium-sized networks |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | Home/small office networks |
Frequently Asked Questions
Why are two addresses unusable in every subnet?
The first address (network address) and the last address (broadcast address) of every subnet have reserved functions and cannot be assigned to hosts. A /24 subnet has 256 total addresses but only 254 are assignable to devices.
What is a /30 subnet used for?
A /30 subnet provides 4 total addresses and 2 usable hosts. It’s the minimum subnet size for a point-to-point link between two routers (one address per router endpoint). Even smaller /31 subnets (RFC 3021) can also be used for point-to-point links, using both addresses.
How do I calculate subnets for a given number of hosts?
Choose the smallest CIDR that provides enough usable hosts. Need 50 hosts? A /26 gives 62 usable. Need 200 hosts? A /24 gives 254 usable. The formula: find the smallest n where 2^n − 2 ≥ required hosts. Your CIDR is 32 − n.
What is the difference between a subnet mask and a prefix length?
They represent the same information in different formats. The prefix length /24 is equivalent to the subnet mask 255.255.255.0. Both indicate that the first 24 bits of the IP address are the network portion.
Does this calculator support IPv6?
Not currently. This calculator handles IPv4 addresses in dotted-decimal notation. IPv6 subnetting follows the same conceptual rules but uses 128-bit addresses in hexadecimal notation and typically uses /48, /64, and /128 prefixes.
What is a wildcard mask used for?
Wildcard masks are used in Cisco ACLs (Access Control Lists) and OSPF area definitions to specify which bits of an IP address must match. A 0 bit means “must match exactly”; a 1 bit means “any value is allowed.” A wildcard of 0.0.0.255 on 192.168.1.0 matches any address in 192.168.1.0/24.