/12 Subnet Mask ReferenceIPv4

Sixteen /16 networks bundled under <code>255.240.0.0</code>: a /12 offers 1,048,574 usable hosts and anchors one of the most recognized lines in networking, the private range <code>172.16.0.0/12</code> from RFC 1918.

The /12 subnet mask is 255.240.0.0, equivalent to 0.15.255.255 as a wildcard. A /12 block contains 1,048,576 IP addresses (1,048,574 usable hosts).

/12 facts at a glance

Subnet mask
255.240.0.0
Wildcard mask
0.15.255.255
Binary mask
11111111.11110000.00000000.00000000
Total addresses
1,048,576
Usable hosts
1,048,574 (excludes network & broadcast)
Block size
1,048,576 addresses (220)
Typical role
Large enterprise and carrier aggregation

Example /12 networks

Three consecutive /12 blocks, starting at the /12 boundary that contains 198.51.100.0:

NetworkUsable rangeUsable hosts
198.48.0.0/12 198.48.0.1 – 198.63.255.254 1,048,574
198.64.0.0/12 198.64.0.1 – 198.79.255.254 1,048,574
198.80.0.0/12 198.80.0.1 – 198.95.255.254 1,048,574

How to calculate a /12 mask

A /12 mask sets the first 12 bits of a 32-bit number to 1 and leaves the remaining 20 bits as 0. In binary that reads 11111111.11110000.00000000.00000000, which converts to dotted decimal 255.240.0.0. Each block covers a contiguous run of 220 = 1,048,576 addresses, and every block starts at a multiple of that size. The wildcard simply flips every bit, giving 0.15.255.255.

Where /12 is used

Neighbor, not subset: carrier-grade NAT lives in <code>100.64.0.0/10</code> (RFC 6598). That /10 is four times the size of a /12 and counts as shared address space, not RFC 1918 private space.

A /12 divides into 16 /16s or 4,096 /24s, which makes hierarchical planning inside it straightforward.

Frequently asked questions

What is 172.16.0.0/12?

The middle RFC 1918 private range, covering 172.16.0.0 through 172.31.255.255. Devices may reuse it freely internally, but it is not routable on the public Internet.

How many hosts are in a /12?

1,048,574 usable of 1,048,576 total; the first and last addresses serve as network and broadcast.

What mask goes with a /12?

<code>255.240.0.0</code>, wildcard <code>0.15.255.255</code>. The twelve fixed bits reach four bits into the second octet.

Why do my containers get 172.17.x.x addresses?

Runtime defaults fall inside the 172.16.0.0/12 private block. If that collides with your corporate network, change the runtime's address pool rather than the corporate plan.

Open the /12 block in the subnet calculator

Get the /12 wildcard mask →

Related prefixes

/11/13/24/26/28/30