What is a subnet calculator?
A subnet calculator takes an IP address and a prefix length, such as 192.168.1.130/26, and works out the
network it belongs to: the network address, the first and last usable host, the broadcast address, the subnet mask
and how many devices fit in it. It saves you from doing binary arithmetic by hand when you plan a network, configure
a router or firewall, or read someone else's configuration.
This calculator handles IPv4 and IPv6, accepts both CIDR prefixes and dotted masks, and can split a network into smaller subnets. It runs entirely in your browser, so it is instant and nothing you type is sent anywhere.
How to use it
- Type an address with a prefix (
10.20.0.0/16), with a mask (10.20.0.0 255.255.0.0) or alone (IPv4 defaults to /24, IPv6 to /64). - The results update as you type: network, host range, mask, wildcard, number of hosts and address type.
- Choose a longer prefix under Split into subnets to list the smaller networks, for example a /24 split into four /26.
- The address bar keeps your input (
?cidr=), so you can bookmark or share the result.
CIDR, masks and hosts
An IPv4 address has 32 bits. The prefix length says how many of them identify the network; the rest identify hosts
inside it. A /24 leaves 8 bits for hosts, which gives 28 = 256 addresses. The subnet mask writes the same
thing as an address: 24 bits set to 1 followed by 8 bits set to 0, which is 255.255.255.0.
In every IPv4 subnet larger than /31, the first address is the network address and the last is the broadcast address, so a subnet has two usable hosts fewer than addresses. Point-to-point links can use a /31 with both addresses usable (RFC 3021), and a /32 describes a single host.
IPv4 subnet cheat sheet
| Prefix | Mask | 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 |
Private and special ranges
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16: private networks (RFC 1918), not routed on the internet.100.64.0.0/10: carrier-grade NAT, used inside ISP networks.127.0.0.0/8: loopback;169.254.0.0/16: link-local, assigned when DHCP fails.fc00::/7: IPv6 unique local addresses;fe80::/10: IPv6 link-local.
The calculator labels each address with its type, so you can spot a private range at a glance.
IPv6 subnetting
IPv6 addresses have 128 bits, so the numbers become astronomical: a single /64 holds more than 18 quintillion addresses. That is why IPv6 is planned by number of networks, not number of hosts. The rule of thumb: every LAN is a /64, a site gets a /48 or /56, and you split it into /64 networks. A /48 gives 65,536 of them; a /56 gives 256. There is no broadcast address in IPv6, so every address in the range is usable.
Next steps
Found a public IP in your range? See who owns it and where it is with IP Lookup, check its name with Reverse DNS, or find your own address on the What is my IP page.