Four tabs for IP address planning, for IPv4 and IPv6:
- Subnet. Type an address with a prefix (
192.168.1.10/24, 10.1.2.3 255.255.240.0 or 2001:db8::1/64) and read the network address, broadcast, first and last host, subnet and wildcard masks, the number of addresses and usable hosts, the reverse DNS zone, the binary form, and which special range it belongs to. A second field checks whether any address is inside the block. - Split. Divide a block into a number of equal subnets or into subnets of a given prefix, with each subnet's host range and broadcast.
- Aggregate. Paste a list of CIDR blocks and get the smallest set that covers exactly the same addresses: overlaps are removed and neighbouring blocks merged (a "supernet").
- IPv6 format. Compress an IPv6 address to its canonical form (RFC 5952) or expand it to all 32 hex digits.
All arithmetic uses exact big integers, so a /64 shows 18,446,744,073,709,551,616 addresses, not a rounded number.
How the numbers are worked out
A prefix length says how many leading bits name the network; the rest number the hosts. For 192.168.1.10/24, the first 24 bits (192.168.1) are the network and the last 8 bits leave 2^8 = 256 addresses, 192.168.1.0 to 192.168.1.255. In IPv4 the first is the network address and the last is the broadcast address, so 254 hosts are usable. The mask is the prefix written as an address, 255.255.255.0, and the wildcard mask, used by Cisco access lists and OSPF, is its inverse, 0.0.0.255.
Two exceptions: a /31 has two addresses and both are usable, for point-to-point links (RFC 3021), and a /32 is a single host. IPv6 has no broadcast address; the first address of a subnet is reserved as the subnet-router anycast address.
Special ranges it recognises
Private networks (10/8, 172.16/12, 192.168/16, RFC 1918), shared address space for carrier-grade NAT (100.64/10, RFC 6598), link-local (169.254/16, RFC 3927), loopback (127/8), multicast (224/4), the documentation ranges (192.0.2/24, 198.51.100/24 and 203.0.113/24, RFC 5737), benchmarking (198.18/15) and the reserved 240/4. For IPv6: loopback, unique local (fc00::/7), link-local (fe80::/10), multicast (ff00::/8), the documentation prefixes 2001:db8::/32 and 3fff::/20, IPv4-mapped, NAT64, 6to4, Teredo and global unicast (2000::/3). The historic class (A to E) is shown for IPv4 too, although routing has ignored classes since CIDR in 1993.
Splitting a network by hand
To split 192.168.1.0/24 into 8 subnets, borrow 3 bits (2^3 = 8), giving /27. Each /27 has 2^5 = 32 addresses, 30 usable, and the subnets start every 32: .0, .32, .64 up to .224. The second one runs from .32 (network) through .33–.62 (hosts) to .63 (broadcast). If you ask for 6 subnets, the tool rounds up to 8, because equal subnets always come in powers of two. The article subnetting by hand: a /24 split into /27s works through it step by step.
Aggregation and IPv6 compression
Two blocks merge only if they are the same size, adjacent, and the first starts on a boundary of the bigger block: 10.0.0.0/24 and 10.0.1.0/24 make 10.0.0.0/23, but 10.0.1.0/24 and 10.0.2.0/24 do not merge, because 10.0.1.0 is not on a /23 boundary. IPv6 compression follows RFC 5952: lower case, leading zeros dropped, the longest run of zero groups replaced by :: (the first one if two runs are equally long, never a single group), and IPv4-mapped addresses written with a dotted tail, such as ::ffff:192.0.2.1. To convert numbers between binary and decimal, see the number base converter.