What does /20 mean?
A /20 leaves 12 host bits: 4,096 addresses, 4,094 usable hosts, with netmask 255.255.240.0. It is exactly sixteen /24 networks, for example 172.31.0.0 to 172.31.15.255.
Worked example: 172.31.0.0/20. Type any block to compare.
172.31.0.0/20 is 4,096 addresses: 172.31.0.0 to 172.31.15.255. 4,094 usable for hosts (the first is the network address, the last is broadcast).
- Network
172.31.0.0- First usable
172.31.0.1- Last usable
172.31.15.254- Broadcast
172.31.15.255- Addresses
4,096- Usable hosts
4,094- Netmask
255.255.240.0- Wildcard (ACL) mask
0.0.15.255- Historic class
B- Range type
Private network · not routed on the internet
Special-purpose range
Private network 172.16.0.0/12 RFC 1918
The middle private IPv4 range: 172.16.0.0 to 172.31.255.255. Docker's default bridge networks are carved from it.
Split it into subnets
4 subnets.
| Subnet | Usable range | Hosts | Broadcast |
|---|---|---|---|
172.31.0.0/22 | 172.31.0.1 – 172.31.3.254 | 1,022 | 172.31.3.255 |
172.31.4.0/22 | 172.31.4.1 – 172.31.7.254 | 1,022 | 172.31.7.255 |
172.31.8.0/22 | 172.31.8.1 – 172.31.11.254 | 1,022 | 172.31.11.255 |
172.31.12.0/22 | 172.31.12.1 – 172.31.15.254 | 1,022 | 172.31.15.255 |
Is this IP in the range?
Range to CIDR blocks
What to know
/20 is where the boundary falls inside the third octet: 240 in the mask means the third number moves in steps of 16, so /20 networks start at x.x.0.0, x.x.16.0, x.x.32.0 and so on.
AWS default VPCs use /20 subnets (172.31.0.0/20, 172.31.16.0/20, ...), one per availability zone. AWS reserves 5 addresses in every subnet, so a /20 gives 4,091 assignable addresses. Docker also uses /20 blocks from 192.168.0.0/16 for new networks once its 172.x /16 pool is used up.
Gotchas
- 172.31.16.0 is the start of a /20, but 172.31.8.0/20 is not a valid network: its host bits are set, and tools will either reject it or silently turn it into 172.31.0.0/20.
- For Kubernetes clusters where every pod gets a VPC address (such as Amazon EKS with the VPC CNI), a /20 per subnet fills faster than you expect. Size subnets for pods, not just nodes.
Related explainers
- What does /16 mean?A /16 fixes the first two octets: 65,536 addresses, 65,534 usable hosts, netmask 255.255.0.0. The largest...
- What does /22 mean?A /22 has 1,024 addresses and 1,022 usable hosts, netmask 255.255.252.0: four /24s joined together. Used...
- What does /24 mean?A /24 has 256 addresses and 254 usable hosts with netmask 255.255.255.0. The typical home and office LAN,...
- IPv4 subnet cheat sheetEvery IPv4 prefix length from /0 to /32 with its netmask, total addresses and usable hosts. How to read...