What is a subnet calculator?
A subnet calculator works out the boundaries of an IP network from an address and its prefix length (CIDR notation such as /24) or subnet mask. It shows where the network starts and ends, which addresses hosts can use, how many there are, and how to split the range into smaller subnets.
How to use the IP subnet calculator
- Enter an address with a prefix:
192.168.10.0/24,10.20.30.40/20or2001:db8:abcd::/48. - Or with a dotted mask:
172.16.5.4 255.255.252.0. The mask must be contiguous (all ones, then all zeros). - Any address inside the network works —
192.168.10.77/24gives the same network as192.168.10.0/24. - Pick a longer prefix under Split into smaller subnets to list the equal-sized subnets that fit.
Nothing you type leaves your browser: the calculation is plain arithmetic in JavaScript. That makes it safe to use with internal address plans.
IPv4 subnet cheat sheet
| CIDR | Subnet mask | Wildcard | Addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /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 (point-to-point, RFC 3021) |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 (a single host) |
Usable hosts are the total minus two: the first address names the network and the last is the broadcast address. The exceptions are /31, used on point-to-point links where both addresses are usable, and /32, a single host route.
How subnetting works
An IPv4 address is 32 bits. The prefix length says how many leading bits identify the network; the remaining bits number the hosts. In 192.168.10.77/24, the first 24 bits (192.168.10) are the network and the last 8 bits leave 256 addresses. The subnet mask is the same idea written as an address — 24 one-bits then 8 zero-bits is 255.255.255.0.
Network address = the address with every host bit set to 0. Broadcast address = every host bit set to 1. The wildcard mask is the inverse of the subnet mask; Cisco ACLs and OSPF statements use it instead of the mask.
Address 192.168.10.77 11000000.10101000.00001010.01001101
Mask /24 255.255.255.0 11111111.11111111.11111111.00000000
Network 192.168.10.0 11000000.10101000.00001010.00000000
Broadcast 192.168.10.255 11000000.10101000.00001010.11111111Each extra prefix bit halves the network: a /24 splits into two /25s, four /26s or eight /27s. The split list shows each one with its first and last usable address.
IPv6 subnetting
IPv6 addresses are 128 bits, so the numbers get large: a single /64 holds 18,446,744,073,709,551,616 addresses. In practice nobody counts hosts. Every LAN is a /64 (SLAAC needs it), a site typically gets a /48 or /56 from its provider, and planning is about how many /64 networks fit — 65,536 in a /48, 256 in a /56.
- IPv6 has no broadcast address; the calculator shows the first and last address of the prefix instead.
fc00::/7is unique local (the IPv6 equivalent of private ranges),fe80::/10is link-local, and2001:db8::/32is reserved for documentation.- Addresses are shown in RFC 5952 short form and fully expanded.
Private, public and special IPv4 ranges
| Range | Use |
|---|---|
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 (shared address space) |
169.254.0.0/16 | Link-local — a device that failed to get an address from DHCP |
127.0.0.0/8 | Loopback (this machine) |
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Documentation examples |