How to Use the Subnet Calculator
The subnet calculator works out everything about a network from an IP address and a prefix length or subnet mask. It supports both IPv4 and IPv6 and accepts input in these formats:
- CIDR notation:
192.168.1.10/24or2001:db8::1/48 - IP address and mask:
192.168.1.10 255.255.255.0 - IP address only: without a prefix,
/24is assumed for IPv4 and/64for IPv6.
For IPv4 you get the network address, broadcast address, first and last usable host, subnet mask, wildcard mask, total and usable address counts, address class (A–E), whether the range is private or public, and a binary view. For IPv6 you get the network address in compressed and full notation, the address range, the exact number of addresses and how many /64 subnets the block contains.
What Are CIDR Notation and Subnet Masks?
An IPv4 address is 32 bits long. The number after the slash in CIDR notation tells you how many of those bits identify the network; the remaining bits are left for hosts. For example, /24 means the first 24 bits belong to the network, which corresponds to the mask 255.255.255.0. The total number of addresses in a subnet is 2(32 − prefix).
The first address of every subnet is the network address and the last one is the broadcast address. Neither can be assigned to a device, which is why the number of usable hosts is two less than the total. There are two exceptions: in a /31, used for point-to-point links, both addresses are usable (RFC 3021), and a /32 refers to a single host. The wildcard mask is the inverse of the subnet mask (0.0.0.255 for a /24) and is used in Cisco access lists (ACLs) and OSPF configuration.
Example: 192.168.1.10/26
A /26 has the mask 255.255.255.192 and splits the network into blocks of 64 addresses. 192.168.1.10 falls into the first block, so the network address is 192.168.1.0, the broadcast address is 192.168.1.63, and the 62 addresses from 192.168.1.1 to 192.168.1.62 can be assigned to devices.
Splitting a /24 into Four Subnets
To divide 192.168.1.0/24 into four equal parts, extend the prefix by 2 bits to /26. That gives you 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26, each with 62 usable addresses. The general rule: every extra prefix bit doubles the number of subnets and halves the number of addresses in each one.
IPv4 CIDR Cheat Sheet
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
IP Address Classes and Private Ranges
Classful addressing became obsolete when CIDR arrived in 1993, but the classes are still widely referenced: addresses whose first octet is 0–127 are Class A, 128–191 Class B and 192–223 Class C. Class D (224–239) is reserved for multicast and Class E (240–255) for experimental use. Home and office networks use the private ranges below, and carriers have a shared range of their own; none of them are routed on the public internet:
10.0.0.0/8: 10.0.0.0 – 10.255.255.255172.16.0.0/12: 172.16.0.0 – 172.31.255.255192.168.0.0/16: 192.168.0.0 – 192.168.255.255100.64.0.0/10: shared address space that carriers use for CGNAT
IPv6 Subnets
IPv6 addresses are 128 bits long, and the standard subnet size on a local network is /64: SLAAC, the method devices use to configure their own addresses, depends on it. A single /64 contains 264, or 18,446,744,073,709,551,616 addresses. ISPs typically assign customers a block somewhere between /48 and /64; a /56 holds 256 /64 subnets and a /48 holds 65,536. Because runs of zero groups can be shortened to ::, the calculator shows the network address in both compressed and full notation. Want to know whether your connection supports IPv6? Check our IPv6 test.