IPv4 Subnet Calculator
All-in-one IP subnetting, CIDR analysis & network planning tool
Tip: you can also type 10.0.0.0/8 or 172.16.5.4 255.255.240.0 directly.
Binary Notation Breakdown
IPv4 Subnet Cheat Sheet & Reference Table
Quick lookup for CIDR prefixes, subnet masks, wildcard masks and host capacity
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /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 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Click any row to load that prefix into the calculator.
How to Use the IPv4 Subnet Calculator
Step-by-step usage and the core subnetting concepts behind every result
Step-by-step instructions
- Enter any IPv4 address in the
IPv4 Addressfield, for example10.0.0.1. - Pick a prefix length or subnet mask from the dropdown, for example
/24 — 255.255.255.0. You can also type the prefix straight into the address field (10.0.0.1/22) or add a dotted mask after a space (10.0.0.1 255.255.252.0). - Results update as you type. Press Calculate or Enter to re-run the calculation at any time.
- Use the copy icon on any result card to copy the value to your clipboard, or click a row in the cheat sheet to load that prefix.
Core subnetting concepts
Network ID vs broadcast address
The network ID is the first address of a subnet and identifies the subnet itself. The broadcast address is the last address and reaches every host on the subnet. Neither can be assigned to a device, which is why usable hosts are the total minus two.
CIDR notation & subnet masks
Classless Inter-Domain Routing (CIDR) writes the mask as a slash and a number, such as /24. The number is how many leading bits are set to 1 in the 32-bit mask: those bits identify the network, and the remaining bits identify hosts.
Calculating host counts
A subnet with prefix n contains 232−n addresses. Subtract two for the network and broadcast addresses to get usable hosts: a /26 has 64 addresses and 62 usable hosts.
Wildcard masks
A wildcard mask is the inverse of the subnet mask (255 minus each octet). Cisco ACLs and OSPF network statements use it: a 0 bit means “must match” and a 1 bit means “ignore”.
Frequently asked questions
What is an IPv4 subnet calculator?
An IPv4 subnet calculator takes an IP address and a subnet mask or CIDR prefix and works out the subnet it belongs to: the network address, broadcast address, usable host range, number of hosts, wildcard mask and the binary form of each value. Network engineers use it to plan address space and to check router, firewall and server configurations.
What is the difference between a /24 and a /25 subnet?
A /24 subnet (mask 255.255.255.0) contains 256 addresses, of which 254 are usable by hosts. A /25 subnet (mask 255.255.255.128) borrows one more bit for the network, splitting a /24 into two halves of 128 addresses each, with 126 usable hosts per subnet.
What is a wildcard mask and where is it used?
A wildcard mask is the inverse of a subnet mask: subtract each octet of the mask from 255. For example, the wildcard for 255.255.255.0 is 0.0.0.255. Cisco access control lists (ACLs) and OSPF network statements use wildcard masks, where a 0 bit means the address bit must match and a 1 bit means it is ignored.
Which IPv4 address ranges are private (RFC 1918)?
RFC 1918 reserves three ranges for private networks that are not routed on the public internet: 10.0.0.0/8 (10.0.0.0 to 10.255.255.255), 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16 (192.168.0.0 to 192.168.255.255).
Why does a /31 subnet have two usable hosts?
Normally the first and last addresses of a subnet are reserved for the network ID and broadcast. RFC 3021 allows /31 subnets on point-to-point links, where no broadcast address is needed, so both addresses can be assigned to the two router interfaces. A /32 identifies a single host and is commonly used for loopback interfaces and host routes.
More Networking & IP Tools
Free browser-based utilities for network engineers and system administrators
Thank you for your message.