Skip to the content

/20 Subnet (255.255.240.0)

A /20 network has 4,096 addresses and the subnet mask 255.255.240.0: sixteen /24 networks under a single mask.

With or without a prefix: 192.168.1.10/24

/20

Network in CIDR notation

172.31.16.0/20

4,094 usable hosts, from 172.31.16.1 to 172.31.31.254.

Network address
172.31.16.0
Broadcast address
172.31.31.255
First usable host
172.31.16.1
Last usable host
172.31.31.254
Usable hosts
4,094
Total addresses
4,096
Subnet mask
255.255.240.0
Wildcard mask
0.0.15.255
IP class
B, default mask /16
Address type
Private (RFC 1918), in 172.16.0.0/12

In binary

Address
10101100.00011111.00010000.00000000
Mask
11111111.11111111.11110000.00000000
Network
10101100.00011111.00010000.00000000
Broadcast
10101100.00011111.00011111.11111111

The line marks where the network part ends: 20 network bits to its left, 12 host bits to its right.

Split into smaller subnets

4 subnets of /22, 1,022 usable hosts each.

  1. 172.31.16.0/22Hosts 172.31.16.1 – 172.31.19.254Broadcast 172.31.19.255
  2. 172.31.20.0/22Hosts 172.31.20.1 – 172.31.23.254Broadcast 172.31.23.255
  3. 172.31.24.0/22Hosts 172.31.24.1 – 172.31.27.254Broadcast 172.31.27.255
  4. 172.31.28.0/22Hosts 172.31.28.1 – 172.31.31.254Broadcast 172.31.31.255
Share this tool:TwitterFacebookLinkedInWhatsAppEmail

/20 at a glance

Subnet mask
255.255.240.0
Mask in binary
11111111.11111111.11110000.00000000
Wildcard mask
0.0.15.255
Addresses in one network
4,096
Usable for hosts
4,094
Networks of this size
16 in a /16, 4,096 in a /8

Where /20 networks begin

The mask stops inside the third number of the address, and one network covers 16 values of it. A new network begins wherever that number is a multiple of 16: 0, 16, 32, 48 and so on up to 240.

172.31.0.0/16 divided into 16 networks of /20

  1. 172.31.0.0/20Hosts 172.31.0.1 – 172.31.15.254Broadcast 172.31.15.255
  2. 172.31.16.0/20Hosts 172.31.16.1 – 172.31.31.254Broadcast 172.31.31.255
  3. 172.31.32.0/20Hosts 172.31.32.1 – 172.31.47.254Broadcast 172.31.47.255
  4. 172.31.48.0/20Hosts 172.31.48.1 – 172.31.63.254Broadcast 172.31.63.255
  5. 172.31.64.0/20Hosts 172.31.64.1 – 172.31.79.254Broadcast 172.31.79.255
  6. 172.31.80.0/20Hosts 172.31.80.1 – 172.31.95.254Broadcast 172.31.95.255
  7. 172.31.96.0/20Hosts 172.31.96.1 – 172.31.111.254Broadcast 172.31.111.255
  8. 172.31.112.0/20Hosts 172.31.112.1 – 172.31.127.254Broadcast 172.31.127.255
  9. 172.31.128.0/20Hosts 172.31.128.1 – 172.31.143.254Broadcast 172.31.143.255
  10. 172.31.144.0/20Hosts 172.31.144.1 – 172.31.159.254Broadcast 172.31.159.255
  11. 172.31.160.0/20Hosts 172.31.160.1 – 172.31.175.254Broadcast 172.31.175.255
  12. 172.31.176.0/20Hosts 172.31.176.1 – 172.31.191.254Broadcast 172.31.191.255
  13. 172.31.192.0/20Hosts 172.31.192.1 – 172.31.207.254Broadcast 172.31.207.255
  14. 172.31.208.0/20Hosts 172.31.208.1 – 172.31.223.254Broadcast 172.31.223.255
  15. 172.31.224.0/20Hosts 172.31.224.1 – 172.31.239.254Broadcast 172.31.239.255
  16. 172.31.240.0/20Hosts 172.31.240.1 – 172.31.255.254Broadcast 172.31.255.255

In practice

AWS uses this size for the default subnets of the default VPC: 172.31.0.0/20, 172.31.16.0/20, 172.31.32.0/20 and so on, one per availability zone.

Writing /20 behind an address that is not on a boundary is a common slip. 10.0.20.0/20 is not a network: 20 is not a multiple of 16, and the address lies inside 10.0.16.0/20. Enter any address in the calculator to see the network it really belongs to.

The subnet calculator takes any address with any prefix or mask, explains the address classes and the private ranges, and splits a network into subnets.