Toolman

/12 subnet

A /12 has a subnet mask of 255.240.0.0 and 1,048,574 usable hosts.

The numbers

Prefix length/12
Subnet mask255.240.0.0
Wildcard mask0.15.255.255
Network bits12
Host bits20
Total addresses1,048,576
Usable hosts1,048,574
/24 networks contained4,096

Where a /12 is used

The size of the middle private range, 172.16.0.0/12 — which covers 172.16 through 172.31 and stops there. Docker allocates its default bridge networks from inside it.

Why the usable count is what it is

A /12 leaves 20 bits for hosts, giving 220 = 1,048,576 addresses. Two of those cannot be assigned to a machine: the one with all host bits set to zero is the network address, which names the subnet itself, and the one with all host bits set to one is the broadcast address. That leaves 1,048,574.

Binary layout

mask   11111111.11110000.00000000.00000000
       ^^^^^^^^^^^^                    
       12 network bits, 20 host bits

Splitting and combining

PrefixUsable hostsRelationship
Twice the size/112,097,150Two /12 networks combine into one /11
This network/121,048,574
Half the size/13524,286One /12 splits into two /13 networks
A quarter/14262,142Four /14 networks fit in a /12

Frequently asked questions

How many hosts are in a /12?

1,048,576 addresses in total, of which 1,048,574 are usable. The first is the network address and the last is the broadcast address, so two are always lost.

What is the subnet mask for /12?

255.240.0.0. The prefix length is the count of leading 1 bits in the mask, so /12 is 12 ones followed by 20 zeros.

What is the wildcard mask for /12?

0.15.255.255 — the bitwise inverse of the subnet mask. Cisco access lists and OSPF network statements take the wildcard rather than the mask; a zero bit must match and a one bit is ignored.

How does a /12 compare to a /24?

A /12 is 4,096 times larger than a /24 — it contains 4,096 of them.

Other prefix lengths

All prefix lengths · Subnet calculator