IP Subnet Calculator
Enter an address and prefix to get the network, broadcast, usable host range, wildcard mask and full binary breakdown — then split the network into smaller subnets.
Photo by Thomas Jensen on Unsplash
IP subnet calculator
Split into smaller subnets
| # | Network | Range | Broadcast |
|---|
Key takeaways
- The network address is the IP ANDed with the mask; the broadcast is the network with all host bits set.
- Each extra prefix bit doubles the number of subnets and halves the hosts in each one.
- Subnets must start on a boundary that is a multiple of their own size, which is why block addresses jump in fixed steps.
How CIDR notation works
An IPv4 address is 32 bits, usually written as four decimal octets. A subnet mask splits those 32 bits into a network part and a host part. CIDR notation writes the split as a single number: /24 means the first 24 bits identify the network and the remaining 8 identify hosts within it.
192.168.10.130/24
IP 11000000.10101000.00001010.10000010
Mask 11111111.11111111.11111111.00000000 /24
\________ network _______/ \ host /
Network 11000000.10101000.00001010.00000000 192.168.10.0
Bcast 11000000.10101000.00001010.11111111 192.168.10.255The network address is the IP bitwise-ANDed with the mask; the broadcast address is the network with all host bits set to 1. Both are reserved, which is why a /24 offers 254 usable hosts rather than 256. You can reproduce the AND operation step by step in the bitwise calculator.
Prefix reference table
| CIDR | Mask | Total | Usable | Typical use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Very large private network |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Campus or large office |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Cloud VPC default |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Department network |
| /24 | 255.255.255.0 | 256 | 254 | Standard LAN segment |
| /25 | 255.255.255.128 | 128 | 126 | Split /24 |
| /26 | 255.255.255.192 | 64 | 62 | Small VLAN |
| /27 | 255.255.255.224 | 32 | 30 | Server rack |
| /28 | 255.255.255.240 | 16 | 14 | Small DMZ |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point link |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point per RFC 3021 |
| /32 | 255.255.255.255 | 1 | 1 | Single host route |
Two special cases: RFC 3021 allows /31 on point-to-point links with no network or broadcast address reserved, and /32 identifies exactly one host, commonly used in firewall rules and route entries.
Private, reserved and special ranges
RFC 1918 sets aside three ranges that are never routed on the public internet:
10.0.0.0/8— 16.7 million addresses. The usual choice for large networks and cloud VPCs.172.16.0.0/12— 1 million addresses across 172.16 to 172.31.192.168.0.0/16— 65,536 addresses. The home-router default.
Others worth recognising: 127.0.0.0/8 is loopback, 169.254.0.0/16 is link-local (the address you get when DHCP fails), 100.64.0.0/10 is carrier-grade NAT space defined by RFC 6598, and 224.0.0.0/4 is multicast. The calculator labels the scope of whatever you enter.
Planning a subnet split
Subnetting divides one network into several smaller ones. Each extra bit of prefix doubles the subnet count and halves the hosts per subnet.
A worked example. You have 10.20.0.0/16 and need four segments:
- Two extra bits give four subnets, so the new prefix is /18.
- Each /18 has 214 = 16,384 addresses, 16,382 usable.
- The blocks are 10.20.0.0/18, 10.20.64.0/18, 10.20.128.0/18 and 10.20.192.0/18.
Two planning rules worth following. Leave room to grow: a segment sized exactly to today’s host count will need renumbering within a year, and renumbering a live network is painful. Keep allocations aligned: subnets must start on a boundary that is a multiple of their size, which is why the third octet jumps by 64 in the example above.
A note on IPv6
This calculator handles IPv4. IPv6 uses 128-bit addresses written as eight groups of four hexadecimal digits, and the arithmetic is the same in principle but the conventions differ:
/64is the standard subnet size for a LAN — not because 18 quintillion hosts are needed, but because stateless address autoconfiguration assumes it./48is the usual allocation to an end site, giving 65,536 /64 subnets.- There is no broadcast address in IPv6; multicast replaces it entirely.
- Address compression rules (
::for the longest run of zero groups) are defined by RFC 5952.
Frequently Asked Questions
What does /24 mean in an IP address?
The first 24 bits identify the network and the remaining 8 identify hosts. That is a 255.255.255.0 mask, 256 total addresses and 254 usable ones.
Why does a /24 have 254 hosts and not 256?
The all-zeros host address identifies the network itself and the all-ones address is the broadcast address. Neither can be assigned to a device.
How do I calculate the network address?
Bitwise-AND the IP address with the subnet mask. The calculator shows both the decimal and binary forms so you can follow the operation.
What is a wildcard mask?
The bitwise inverse of the subnet mask. Cisco access control lists and OSPF configuration use it: 0.0.0.255 is the wildcard for a /24.
What is the difference between a public and private IP?
Private ranges (10/8, 172.16/12, 192.168/16) are never routed on the public internet and are reused inside every organisation. Public addresses are globally unique and allocated by regional registries.
Can a subnet have a /31 prefix?
Yes, on point-to-point links. RFC 3021 allows /31 with both addresses usable, since a two-node link needs no broadcast address.
How many subnets can I create from a /16?
It depends on the new prefix. Each additional bit doubles the count: /17 gives 2, /18 gives 4, /24 gives 256, /28 gives 4,096. The split table calculates this for you.
Sources & further reading
- RFC 4632: CIDR — the classless addressing and aggregation specification
- RFC 1918: Private address space — the three reserved private ranges
- RFC 3021: 31-bit prefixes — why /31 works on point-to-point links
- RFC 6598: Shared address space — the 100.64.0.0/10 carrier-grade NAT range