tip
~/geeksubnet/masks/12

/12 subnet mask: 255.240.0.0

Every value on this page is reproducible in the calculator.

The /12 prefix means the first 12 bits of the address identify the network and the remaining 20 identify the host. Written out, the mask is 255.240.0.0, in binary 11111111.11110000.00000000.00000000, and its Cisco wildcard or inverse form is 0.15.255.255. It covers 1,048,576 addresses, of which 1,048,574 can be given to hosts.

/12 at a glance

CIDR prefix/12
Subnet mask255.240.0.0
Mask in binary11111111.11110000.00000000.00000000
Wildcard (inverse) mask0.15.255.255
Host bits20
Total addresses1,048,576
Usable hosts1,048,574
Block size (magic number)16 in octet 2

Every /12 inside 10.0.0.0/8

A 10.0.0.0/8 contains 16 subnets of /12. Here are the first 8, which is enough to see the pattern: each one starts 16 after the last in octet 2.

NetworkFirst hostLast hostBroadcast
10.0.0.0/1210.0.0.110.15.255.25410.15.255.255
10.16.0.0/1210.16.0.110.31.255.25410.31.255.255
10.32.0.0/1210.32.0.110.47.255.25410.47.255.255
10.48.0.0/1210.48.0.110.63.255.25410.63.255.255
10.64.0.0/1210.64.0.110.79.255.25410.79.255.255
10.80.0.0/1210.80.0.110.95.255.25410.95.255.255
10.96.0.0/1210.96.0.110.111.255.25410.111.255.255
10.112.0.0/1210.112.0.110.127.255.25410.127.255.255

The magic number for /12

Take the interesting octet of the mask, the one that is neither 255 nor 0. For /12 that is 240 in octet 2. Subtract it from 256:

256 - 240 = 16

That is the block size. Every /12 network address is a multiple of 16 in octet 2, so you can list them by counting: 0, 16, 32, 48, and so on. No binary needed once you know the number.

Where a /12 shows up in practice

The /12 is the middle RFC 1918 block, 172.16.0.0/12, covering 172.16.0.0 through 172.31.255.255. It is the range Docker and several hypervisors reach for by default when they need private space, which is exactly why it collides so often with corporate VPN routes.

Frequently asked questions

How many hosts are in a /12?

A /12 holds 1,048,576 addresses in total. After reserving the network and broadcast addresses, 1,048,574 are usable by hosts.

What is the subnet mask for /12?

The /12 subnet mask is 255.240.0.0 in dotted-decimal notation.

What is the wildcard mask for /12?

The wildcard mask, also called the inverse mask, is 0.15.255.255. It is the bitwise inverse of 255.240.0.0 and is what Cisco access lists and OSPF network statements expect.

What is /12 in binary?

The /12 mask written out bit by bit is 11111111.11110000.00000000.00000000: 12 ones followed by 20 zeros.

Neighbouring masks: /11 is one bit shorter and holds twice as many addresses. /13 is one bit longer and holds half as many.
full cheat sheet subnetting basics open the calculator