breakitdown

What does /16 mean?

Answer

A /16 keeps the first 16 bits (the first two numbers) fixed and leaves 16 bits for hosts: 65,536 addresses, 65,534 usable as hosts. The netmask is 255.255.0.0.

Worked example: 172.31.0.0/16. Type any block to compare.

Try

172.31.0.0/16 is 65,536 addresses: 172.31.0.0 to 172.31.255.255. 65,534 usable for hosts (the first is the network address, the last is broadcast).

172101011003100011111000000000000000000
16 network bits 16 host bits
Network
172.31.0.0
First usable
172.31.0.1
Last usable
172.31.255.254
Broadcast
172.31.255.255
Addresses
65,536
Usable hosts
65,534
Netmask
255.255.0.0
Wildcard (ACL) mask
0.0.255.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

or

4 subnets.

SubnetUsable rangeHostsBroadcast
172.31.0.0/18172.31.0.1 – 172.31.63.25416,382172.31.63.255
172.31.64.0/18172.31.64.1 – 172.31.127.25416,382172.31.127.255
172.31.128.0/18172.31.128.1 – 172.31.191.25416,382172.31.191.255
172.31.192.0/18172.31.192.1 – 172.31.255.25416,382172.31.255.255

Is this IP in the range?

Range to CIDR blocks

What to know

/16 is the old Class B size and the most common size for a whole private network plan per environment, region or site. 192.168.0.0/16 is one of the three private ranges.

On AWS, /16 is the largest CIDR block a VPC can have (a VPC can be anything from /16 to /28). The default VPC in every region is 172.31.0.0/16, split into one /20 subnet per availability zone.

Docker's default bridge, docker0, is 172.17.0.0/16, and new Docker networks take further /16s from the 172.16.0.0/12 range by default.

Gotchas

Related explainers

← CIDR calculator