What the subnet calculator does
Enter an IPv4 address and a prefix length (CIDR notation such as /24) or a subnet mask, and the calculator returns everything you need to configure or document the network: the network address, broadcast address, subnet mask in dotted and binary form, the first and last usable host addresses, the number of usable hosts, and the wildcard mask used in access lists. Calculations are bitwise operations performed in your browser.
How subnetting works
An IPv4 address is 32 bits. The prefix length says how many of those bits, from the left, identify the network; the rest identify the host within it. A /24 uses 24 bits for the network and leaves 8 for hosts — 256 addresses, of which the first (all host bits zero) is the network address and the last (all ones) is the broadcast address, leaving 254 usable.
Address 192.168.1.130 = 11000000.10101000.00000001.10000010
Mask /26 255.255.255.192 = 11111111.11111111.11111111.11000000
Network = address AND mask = 192.168.1.128
Broadcast = network OR NOT mask = 192.168.1.191
First host = 192.168.1.129 Last host = 192.168.1.190
Usable hosts = 2^(32−26) − 2 = 62Prefix length reference
| CIDR | Subnet mask | Addresses | Usable hosts | Typical use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | 10.0.0.0/8 private range |
| /16 | 255.255.0.0 | 65,536 | 65,534 | 172.16.0.0/12 blocks, campus networks |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Cloud VPC subnets |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Large office LAN |
| /24 | 255.255.255.0 | 256 | 254 | The default home / small office LAN |
| /25 | 255.255.255.128 | 128 | 126 | Splitting a /24 in two |
| /26 | 255.255.255.192 | 64 | 62 | Department VLAN |
| /27 | 255.255.255.224 | 32 | 30 | Small VLAN, DMZ |
| /28 | 255.255.255.240 | 16 | 14 | Management network |
| /29 | 255.255.255.248 | 8 | 6 | ISP hand-off to a customer |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point links |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | Point-to-point, no broadcast |
| /32 | 255.255.255.255 | 1 | 1 | A single host route / loopback |
Private and special ranges
- 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 — private addresses (RFC 1918), not routed on the internet; used behind NAT.
- 100.64.0.0/10 — carrier-grade NAT shared space.
- 127.0.0.0/8 — loopback; 127.0.0.1 is localhost.
- 169.254.0.0/16 — link-local, self-assigned when DHCP fails.
- 224.0.0.0/4 — multicast. 240.0.0.0/4 — reserved.
Splitting a network
Each extra prefix bit halves the block. To carve a /24 into four equal subnets, use /26: 192.168.1.0/26, .64/26, .128/26 and .192/26. Subnets of different sizes (variable-length subnet masking) are fine as long as they do not overlap and each starts on a boundary that is a multiple of its size — a /27 must start at .0, .32, .64 and so on. The calculator's network address output confirms whether an address you have chosen is a valid boundary: if the network address differs from what you typed, it is not.
Wildcard masks
Cisco access lists and OSPF configuration use the inverse of the subnet mask: a wildcard of 0.0.0.255 matches any host in a /24. The calculator shows it alongside the mask so you can copy it directly into an ACL.