CIDR reference · IPv4

The /20 CIDR block

4,096 addresses, 4,094 usable, subnet mask 255.255.240.0.

/20 · 255.255.240.0 Open in the calculator

4,096 addresses (16 /24s). The default subnet size in AWS's default VPC is /20, which is why default subnets show 4,091 available addresses.

Key numbers

Prefix length/20 (20 network bits, 12 host bits)
Subnet mask255.255.240.0
Mask in binary11111111.11111111.11110000.00000000
Wildcard mask0.0.15.255
Total addresses4,096
Usable hosts4,094 (total minus network and broadcast)
Contains16 × /24 networks
Block sizeIncrements of 16 in octet 3

Example ranges

Private (RFC 1918) blocks of this size. Click one to open it in the calculator.

BlockFirst addressLast addressUsable hosts
10.0.0.0/2010.0.0.010.0.15.25510.0.0.1 – 10.0.15.254
172.16.0.0/20172.16.0.0172.16.15.255172.16.0.1 – 172.16.15.254
192.168.0.0/20192.168.0.0192.168.15.255192.168.0.1 – 192.168.15.254

Usable addresses in the cloud

Cloud providers reserve a few addresses in every subnet for the router, DNS and future use, so the usable count is lower than the formula gives.

ProviderUsable in a /20Notes
AWS VPC subnet4,091Allowed (/16 to /28). AWS reserves the first four addresses and the last one.
Azure virtual network subnet4,091Allowed. Azure reserves the first four addresses and the last one.
Google Cloud subnet4,092Allowed. Google Cloud reserves the first two and the last two addresses.

How the numbers are derived

An IPv4 address has 32 bits. A /20 uses 20 of them for the network, leaving 12 host bits, so the block has 212 = 4,096 addresses. The first address (all host bits 0) is the network address and the last (all host bits 1) is the broadcast address, which leaves 4,094 for hosts. The subnet mask is 20 ones followed by 12 zeros, written in dotted decimal as 255.255.240.0; the wildcard mask 0.0.15.255 is its inverse, used in Cisco ACLs and OSPF configuration.

FAQ

How many hosts can a /20 have?

4,096 addresses in total, of which 4,094 are usable after removing the network and broadcast addresses. Cloud providers reserve a few more: 4,091 usable in AWS and Azure, 4,092 in Google Cloud.

How many /24 subnets fit in a /20?

16. Each step of the prefix length halves or doubles the block, so a /20 contains 2^(24 − 20) = 16 networks of /24 size.