Tools / cidr / common

How many usable hosts in a /12?

A /12 subnet has 1,048,576 IP addresses and 1,048,574 usable hosts. The first address is the network address and the last is the broadcast address, so neither can go on a host. Its netmask is 255.240.0.0 and its wildcard mask is 0.15.255.255.

/12 at a glance

Prefix
/12
Netmask
255.240.0.0
Wildcard
0.15.255.255
Addresses
1,048,576
Usable hosts
1,048,574

Example: 10.0.0.0/12

Network
10.0.0.0
Broadcast
10.15.255.255
Hosts
10.0.0.1 – 10.15.255.254

Usable IPs in a /12 cloud subnet

As a cloud subnet it leaves 1,048,571 usable on Azure and 1,048,572 on Google Cloud; it is too large for AWS, which allows /16 to /28.

ProviderUsable
AWS VPCReserves 5: network, VPC router, DNS, one held for future use, broadcastNot allowed (/16–/28 only)
Azure VNetReserves 5: network, default gateway, two for Azure DNS, broadcast1,048,571
Google Cloud VPCReserves 4: network, default gateway, second-to-last, broadcast1,048,572

Questions

Quick answers.

Worked out with the same code as the CIDR calculator, which takes any IPv4 block and also splits it and checks overlaps.

What is the subnet mask for a /12?

255.240.0.0. In binary it is 12 ones followed by 20 zeros. The wildcard mask, which Cisco ACLs and OSPF use, is 0.15.255.255.

How many /24 subnets fit in a /12?

4,096. A /12 holds 1,048,576 addresses and a /24 holds 256, so it splits into 4,096 /24 subnets of 254 usable hosts each.