IP subnet and CIDR calculator
IPv4 and IPv6 subnetting: mask, wildcard, network, broadcast, host range and count, a binary view, VLSM splits and AWS/Azure/GCP reserved hosts.
- Runs in your browser
- Nothing you enter is sent
- Free, no account
| CIDR notation | 192.168.1.0/24 | |
| Subnet mask | 255.255.255.0 | |
| Wildcard mask | 0.0.0.255 | |
| Host range | 192.168.1.1 – 192.168.1.254 | |
| Mask in binary | 11111111.11111111.11111111.00000000 | |
| Network in binary | 11000000.10101000.00000001.00000000 | |
| Class | C | |
| Scope | Private (RFC 1918, 192.168.0.0/16) | |
| Integer range | 3232235776 – 3232236031 |
prefix /24 mask = 11111111.11111111.11111111.00000000 (255.255.255.0) address = 11000000.10101000.00000001.00000000 (192.168.1.0) AND = 11000000.10101000.00000001.00000000 (192.168.1.0) hosts = 2^(32 − 24) − 2 = 254
Must be longer than /24.
4 subnets of 64 addresses each.
| Subnet | First host | Last host | Broadcast |
|---|---|---|---|
| 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
| 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 |
| 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 |
| Compressed | 2001:db8:85a3::8a2e:370:7334 | |
| Expanded | 2001:0db8:85a3:0000:0000:8a2e:0370:7334 | |
| Network | 2001:db8:85a3::/64 | |
| First address | 2001:db8:85a3:: | |
| Last address | 2001:db8:85a3:0:ffff:ffff:ffff:ffff | |
| Addresses in prefix | 18,446,744,073,709,551,616 | |
| /64 subnets available | 1 |
What the prefix actually does
An IPv4 address is 32 bits. The prefix says how many of those bits identify the network; the
rest identify a host inside it. A /24 fixes the first 24 bits, leaving 8 host bits
and therefore 2⁸ = 256 addresses.
address 192.168. 1. 10 = 11000000 10101000 00000001 00001010
mask 255.255.255. 0 = 11111111 11111111 11111111 00000000
AND ---------------------------------------------------------
network 192.168. 1. 0 = 11000000 10101000 00000001 00000000 Every other figure follows from that AND. The broadcast address is the network with all host bits set; the wildcard mask is the mask inverted; the host range is everything in between.
The reference table
| Prefix | Mask | Addresses | Usable hosts | Cloud usable |
|---|---|---|---|---|
| /16 | 255.255.0.0 | 65,536 | 65,534 | 65,531 |
| /20 | 255.255.240.0 | 4,096 | 4,094 | 4,091 |
| /24 | 255.255.255.0 | 256 | 254 | 251 |
| /25 | 255.255.255.128 | 128 | 126 | 123 |
| /26 | 255.255.255.192 | 64 | 62 | 59 |
| /27 | 255.255.255.224 | 32 | 30 | 27 |
| /28 | 255.255.255.240 | 16 | 14 | 11 |
| /30 | 255.255.255.252 | 4 | 2 | — |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | — |
| /32 | 255.255.255.255 | 1 | 1 (single host) | — |
Why the cloud column is different
AWS, Azure and GCP each reserve five addresses in every subnet rather than two. In an AWS VPC
subnet 10.0.0.0/24:
10.0.0.0— network address10.0.0.1— the VPC router10.0.0.2— DNS resolver10.0.0.3— reserved for future use10.0.0.255— broadcast address (reserved even though VPCs do not support broadcast)
AWS also refuses subnets smaller than /28, which after reservations leaves eleven usable addresses. Turn on cloud mode above to see the corrected count for your own block.
Planning with VLSM
Variable-length subnet masking means allocating each subnet only as much space as it needs instead of splitting everything evenly. The method:
- List every subnet you need with its host count, largest first.
- Round each up to the next power of two, remembering to add two for network and broadcast — or five in a cloud VPC.
- Allocate the largest from the start of the block, then the next, and so on.
- Leave the tail unallocated for growth; expanding later is far easier than renumbering.
The split table above lists every subnet at a chosen prefix, which is the working document for that process.
IPv6 is different in one important way
There is no broadcast address and no host-count arithmetic to worry about, because every LAN gets a /64 regardless of how many devices are on it — that is what SLAAC requires. Site allocations are typically /48, which contains 65,536 of those /64s. The IPv6 panel above uses BigInt throughout, so a /32 reports its 79,228,162,514,264,337,593,543,950,336 addresses exactly rather than as a rounded float.
No lookups, ever
This is arithmetic on the bits you typed. There is no WHOIS, no geolocation and no reverse DNS, because all three require a network call and this site makes none. Everything here works with the network disconnected — including on a plane, which is when subnet planning tends to happen.
Questions
Why does a /24 give 254 usable hosts, not 256?
The first address identifies the network and the last is the broadcast address, so both are unusable. 2⁸ = 256 total, minus 2, is 254.
Why does AWS say my /24 has 251 hosts?
AWS, Azure and GCP each reserve five addresses per subnet: the network address, the router, a DNS resolver, one reserved for future use, and the broadcast address. Turn on cloud mode to see that count.
Is a /31 really usable?
Yes, on point-to-point links. RFC 3021 redefines both addresses in a /31 as host addresses, because a two-node link has no need for a broadcast address. Most router platforms support it.
Does this look up who owns an address?
No, and it never will. WHOIS and geolocation need a network call, which this site does not make. Everything here is arithmetic on the bits you typed.
How do I plan a VLSM split?
Start from the largest subnet you need, take it from the front of the block, then carve the next size out of what remains. The split table on this page lists every subnet at a chosen prefix so you can allocate from it.