How to use
- Type an IP with a prefix length, such as
192.168.1.10/24. A dotted mask also works (172.16.5.4 255.255.240.0), and IPv6 (2001:db8::1/64) goes in the same box. - You get the network address, broadcast address, usable host range and count, subnet mask, wildcard mask and the binary form. Use the Copy button next to a value to take it with you.
- Under Split into subnets, enter a new prefix (for example
/26) or the number of subnets you need to see the child subnets. The table shows up to 256 rows and tells you how many more there are. - Under Membership check, enter another IP to see whether it falls inside the range.
How the math works
An IPv4 address is a 32-bit integer. A prefix length /n means the first n bits are the network part, and the subnet mask is those bits set to 1.
- Network address = IP AND mask
- Broadcast address = network address OR wildcard (the inverted mask)
- Usable hosts = everything after the network address and before the broadcast
Example: 192.168.1.130/26 has mask 255.255.255.192, network 192.168.1.128, broadcast 192.168.1.191 and hosts 192.168.1.129 – 192.168.1.190 (62 of them). The wildcard mask is 0.0.0.63, which router ACLs use in place of a mask.
CIDR table (/8 – /30)
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /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, /32 and special ranges
Normally the network and broadcast addresses can’t be assigned to hosts, so two addresses are subtracted from the total. The exceptions: a /31 is a point-to-point link where both addresses are hosts (RFC 3021), so it has 2 hosts, and a /32 is a single host (1). /0 is the entire IPv4 space.
| Range | Meaning |
|---|---|
| 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | Private addresses (RFC 1918) |
| 100.64.0.0/10 | Carrier-grade NAT shared space |
| 127.0.0.0/8 | Loopback |
| 169.254.0.0/16 | Link-local (self-assigned when DHCP fails) |
| 224.0.0.0/4 | Multicast |
The A–E classes date from the classful era. Networks are carved up with CIDR today, so treat the class as informational.
IPv6 basics
An IPv6 address is 128 bits, written as eight 16-bit groups in hex. One run of zero groups can be shortened to ::. This tool follows RFC 5952: only the longest run of zeros is shortened, the first one wins a tie, and a single zero group is never shortened. For example, 2001:db8:0:0:1:0:0:1 becomes 2001:db8::1:0:0:1.
The standard prefix for an ordinary LAN is /64. For 2001:db8:abcd:12::1/64 the network is 2001:db8:abcd:12::/64, holding 2^64 = 18,446,744,073,709,551,616 addresses. A zone ID after %, as in fe80::1%eth0, is just an interface name and is dropped from the calculation.
Related tools: Number Base Converter for binary and hex views, User-Agent Parser for client details, and HTTP Status Codes for response codes.
Addresses you enter are processed in your browser and never sent to a server.