Subnet Calculator
Free IPv4 CIDR Calculator
Enter any IP address in CIDR notation to instantly calculate network address, broadcast address, first and last host, subnet mask, wildcard mask, and usable host count. No page reloads — all math runs in your browser.
Calculate Subnet
Enter CIDR notation or IP + mask
IPv4 Subnet Cheat Sheet
All 33 CIDR prefixes — /0 through /32 — with subnet mask, wildcard, host counts, and common uses
| CIDR | Subnet Mask | Wildcard Mask | Total IPs | Usable Hosts | Common Use |
|---|---|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,296 | 4,294,967,294 | Default route (entire Internet) |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,648 | 2,147,483,646 | Half of address space |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,824 | 1,073,741,822 | Quarter of address space |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,912 | 536,870,910 | Eighth of address space |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,456 | 268,435,454 | Large ISP block |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,728 | 134,217,726 | Large ISP block |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,864 | 67,108,862 | Large ISP block |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,432 | 33,554,430 | Large ISP block |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 | Class A network (e.g. 10.0.0.0/8) |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,608 | 8,388,606 | Half class A |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,304 | 4,194,302 | Quarter class A |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,152 | 2,097,150 | Large enterprise block |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,576 | 1,048,574 | 172.16.0.0/12 RFC 1918 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,288 | 524,286 | Large enterprise |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,144 | 262,142 | Large enterprise |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,072 | 131,070 | Large enterprise |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 | Class B / 192.168.0.0/16 RFC 1918 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,768 | 32,766 | Half class B |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,384 | 16,382 | Large campus network |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,192 | 8,190 | Medium campus network |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 | Medium network / AWS VPC default |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,048 | 2,046 | Small campus |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 | Small campus / AWS subnet |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 | Two merged /24s |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 | Class C / typical LAN segment |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 | Half class C |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 | Quarter class C |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 | Small workgroup / VLAN |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 | Small office / DMZ segment |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 | Small server cluster |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 | Point-to-point WAN link |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 | Point-to-point link (RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 | Host route / loopback |
Note: Usable hosts = Total IPs − 2 (network + broadcast addresses). Exceptions: /31 uses both addresses for point-to-point links per RFC 3021; /32 is a single host route.
How IP Subnetting Works
CIDR Notation
CIDR (Classless Inter-Domain Routing) notation writes an IP address followed by a slash and a prefix length — for example 192.168.1.0/24. The prefix length tells you how many bits of the 32-bit IP address belong to the network part. The remaining bits identify individual hosts within that network.
Network & Broadcast Addresses
Every subnet has two reserved addresses that cannot be assigned to hosts. The network address (all host bits set to 0) identifies the subnet in routing tables. The broadcast address (all host bits set to 1) is used to send packets to every host on the subnet simultaneously. This is why a /24 has 256 total addresses but only 254 usable — two are reserved.
Subnet Mask & Wildcard Mask
The subnet mask is the CIDR prefix expressed in dotted-decimal: /24 becomes 255.255.255.0. The wildcard mask is its bitwise inverse: 0.0.0.255. Wildcard masks are used in ACLs and OSPF configurations to specify which bits of an address are significant.
Special Cases: /31 and /32
A /31 subnet (RFC 3021) is used for point-to-point links between two routers. Because there are only two addresses and no need for a broadcast, both are usable as host addresses. A /32 is a host route — a single IP address used for loopback interfaces and specific policy routes.
VLSM — Variable Length Subnet Masking
VLSM lets you carve an address block into subnets of different sizes. A 10.0.0.0/24 block could be split into one /26 (62 hosts), two /28s (14 hosts each), and eight /30s (2 hosts each) — all from the same /24. Modern protocols like OSPF and BGP carry the mask with every route, making VLSM the standard approach for efficient IP allocation.
192.168.1.0
255.255.255.0
0.0.0.255
192.168.1.1
192.168.1.254
192.168.1.255
254
11111111.11111111.11111111.00000000
Frequently Asked Questions
Everything you need to know about subnet calculation and CIDR notation
What is a subnet calculator?
A subnet calculator takes an IP address and a prefix length (CIDR notation, e.g. 192.168.1.0/24) and computes the network address, broadcast address, first and last usable host addresses, subnet mask, wildcard mask, and the number of usable hosts. It's an essential tool for network engineers, sysadmins, and developers planning IP address allocation — whether for on-premises infrastructure, cloud VPCs, or firewall ACLs.
How do I calculate a subnet mask from an IP address?
Enter the IP address and prefix in the calculator above, for example 10.0.0.0/8. The tool instantly shows the subnet mask (255.0.0.0 for /8), wildcard mask, network address, broadcast address, and host range. You can also enter the mask directly as 10.0.0.0 255.0.0.0 — both formats are accepted. The subnet mask is derived by setting the first N bits to 1 and the remaining 32−N bits to 0, then writing it in dotted-decimal.
What does /24 mean in CIDR notation?
/24 means the first 24 bits of the IP address are the network part and the remaining 8 bits are for hosts. This gives a subnet mask of 255.255.255.0, a total of 256 addresses (0–255 in the last octet), and 254 usable host addresses — network (.0) and broadcast (.255) are reserved. The /24 is the most common subnet size — it maps to the old "Class C" network and is the default LAN segment in most home and office networks.
How many hosts are in a /27 subnet?
A /27 subnet has 32 total addresses (25 = 32, since 32−27 = 5 host bits). Two are reserved — the network address and the broadcast address — leaving 30 usable host addresses. The subnet mask is 255.255.255.224 and the wildcard mask is 0.0.0.31. A /24 can be split into exactly 8 /27 subnets.
What's the difference between network and broadcast addresses?
The network address is the first address in a subnet (all host bits set to 0). It identifies the subnet itself and appears in routing tables — no device can be assigned this address. The broadcast address is the last address in the subnet (all host bits set to 1). Packets sent to the broadcast address are delivered to every host on that subnet simultaneously. Both are unusable as individual host addresses, which is why a /24 has only 254 usable hosts despite having 256 total addresses.
What is VLSM (Variable Length Subnet Masking)?
VLSM allows a network to be divided into subnets of different sizes rather than using a single uniform mask. For example, you can allocate a /30 (4 addresses, 2 usable) for a point-to-point link between routers, a /28 (16 addresses, 14 usable) for a small server cluster, and a /24 (256 addresses, 254 usable) for a large office LAN — all carved from the same larger block. Modern routing protocols like OSPF, EIGRP, and BGP carry the mask with every route advertisement, making VLSM the standard approach for efficient IP address utilisation.
Why can't I use all addresses in a subnet?
Two addresses in every IPv4 subnet are reserved by the IP protocol: the first address (network address) identifies the subnet in routing tables, and the last address (broadcast address) is used to reach all hosts on the subnet at once. The only exceptions are /31 subnets (RFC 3021), where both addresses are usable because there are only two hosts and no need for a broadcast domain, and /32, which is a single host route where the address is the host itself.
Simple, transparent pricing
Start small, scale as you grow. No hidden fees.
Need IP data in your application?
Geolocation, ASN, threat intelligence, and network prefix data for any IP address — all via a simple REST API.