What a /12 subnet is: the 172.16 private block
A /12 holds 1,048,576 addresses. In practice it means 172.16.0.0/12, the middle private range, which covers 172.16.0.0 through 172.31.255.255.
At a glance
- Subnet mask
- 255.240.0.0
- Wildcard mask
- 0.15.255.255
- Total addresses
- 1,048,576
- Usable hosts
- 1,048,574
- Contains
- 4,096 networks of /24
- Host bits
- 20 of 32
In detail
The mask is 255.240.0.0. The first octet is fixed at 172 and the top four bits of the second octet are fixed, which is why the range stops at 172.31 and not at 172.255.
This is the private block people get wrong most often, because the boundary is not on an octet. 172.15.0.0 and 172.32.0.0 are public addresses belonging to somebody else.
Before using anything in 172.x, check the second octet is between 16 and 31 inclusive. The subnet calculator will show you the range for any address you type, which is faster than counting bits.
Examples
172.16.0.0/12 private, 172.16.0.0 to 172.31.255.255
172.15.255.254 public, not yours
172.31.255.254 private, inside the block
172.32.0.1 public, not yoursThings that catch people out
- A common container runtime default sits inside 172.16.0.0/12, so a virtual private network route for the whole /12 will collide with local container networking on the same machine.
- Writing 172.16.0.0/16 when you meant the whole private block gives you one sixteenth of it and quietly leaves 172.17 through 172.31 routed somewhere else.
Try it: IP Subnet Calculator
Enter any IPv4 address with a prefix or a dotted mask and get the network address, broadcast address, wildcard mask, usable host range, address class, and the hex and binary forms.
IP Subnet Calculator
LOCAL · Browser-OnlyCalculate IP subnet details, network ranges, and CIDR notation
192.168.1.0192.168.1.255255.255.255.00.0.0.255192.168.1.0/24192.168.1.1 - 192.168.1.254192.168.1.1192.168.1.254256254C0xC0A8016411000000.10101000.00000001.01100100Split into two /25 subnets
Dividing 192.168.1.0/24 one prefix deeper.
Common Subnet Masks
Related IPv4 subnets
All ipv4 subnets →What a /8 subnet is: a full class A block
A /8 uses the mask 255.0.0.0 and gives 16,777,214 usable addresses. What it is for and where it goes wrong.
What a /16 subnet is: a full class B block
A /16 uses the mask 255.255.0.0 and gives 65,534 usable addresses. What it is for and where it goes wrong.
What a /10 subnet is: the carrier-grade NAT block
A /10 uses the mask 255.192.0.0 and gives 4,194,302 usable addresses. What it is for and where it goes wrong.
What a /14 subnet is: a four-way /16 aggregate
A /14 uses the mask 255.252.0.0 and gives 262,142 usable addresses. What it is for and where it goes wrong.
What a /18 subnet is: a quarter of a /16
A /18 uses the mask 255.255.192.0 and gives 16,382 usable addresses. What it is for and where it goes wrong.
What a /20 subnet is: sixteen /24s
A /20 uses the mask 255.255.240.0 and gives 4,094 usable addresses. What it is for and where it goes wrong.
Tools for this
- IP Subnet Calculator Free online IP subnet calculator - calculate IP subnet details, CIDR notation, and network address ranges
- IP Address Lookup Free online IP address lookup - find your public IP address and basic network information
- Number Base Converter Free online number base converter - convert numbers between decimal, binary, octal, and hexadecimal