Skip to content
Tape and Square

N-01 · Subnet · /20

/20 subnet

A /20 network keeps 20 of the 32 address bits for the network and leaves 12 for hosts. Its mask, host count, the blocks it fits in and example networks, all worked out below.

Short answer

Subnet mask
255.255.240.0Wildcard 0.0.15.255
Usable hosts
4,0944,096 addresses in total

2^12 = 4,096 addresses. The first is the network address and the last the broadcast, so 4,094 can go to devices.

The /20 mask in binary and hex

20 one bits, then 12 zero bits. The wildcard is the mask inverted.

MaskDottedHex
Subnet mask255.255.240.0FF.FF.F0.00
Wildcard0.0.15.25500.00.0F.FF

The mask ends inside the third octet, at 240 (11110000). That leaves 4 host bits in the octet, so /20 networks start every 16 in it: 0, 16, 32, 48 and so on. Cisco access lists take the wildcard form, 0.0.15.255, where a 1 bit means “any value” (Cisco document 23602).

RFC 1878's table lists /20 as FF.FF.F0.00 hex, 4 K addresses, equal to 16 C in the old class terms. Its Table 1-1 counts a /20 as 16 subnets of a class B network with 4,094 hosts each. Erratum 3147 corrects that table's last row for each size: the all-ones subnet ends at N.N.255.255.

How many /20 subnets fit

The three private ranges (RFC 1918) and one /24.

Block/20 subnets in it
10.0.0.0/84,096
172.16.0.0/12256
192.168.0.0/1616
192.168.181.0/24none: one /20 holds 16

10.0.0.0/8 holds 4,096, 172.16.0.0/12 holds 256 and 192.168.0.0/16 holds 16 /20 subnets. One /20 spans 16 /24s.

Splitting a /20

Each extra prefix bit halves the block.

IntoSubnetsUsable each
/2122,046
/2241,022
/238510

Two /21 subnets hold 4,092 usable addresses between them, 2 fewer than one /20: each half gives up its own network and broadcast address.

/20 subnets of 192.168.0.0/16

192.168.0.0/16 holds 16 of them. The row in bold holds 192.168.181.150.

SubnetFirst usableLast usable
192.168.0.0/20192.168.0.1192.168.15.254
192.168.16.0/20192.168.16.1192.168.31.254
192.168.32.0/20192.168.32.1192.168.47.254
192.168.48.0/20192.168.48.1192.168.63.254
192.168.64.0/20192.168.64.1192.168.79.254
192.168.80.0/20192.168.80.1192.168.95.254
192.168.96.0/20192.168.96.1192.168.111.254
192.168.112.0/20192.168.112.1192.168.127.254
192.168.128.0/20192.168.128.1192.168.143.254
192.168.144.0/20192.168.144.1192.168.159.254
192.168.160.0/20192.168.160.1192.168.175.254
192.168.176.0/20192.168.176.1192.168.191.254
192.168.192.0/20192.168.192.1192.168.207.254
192.168.208.0/20192.168.208.1192.168.223.254
192.168.224.0/20192.168.224.1192.168.239.254
192.168.240.0/20192.168.240.1192.168.255.254

Check an address

Pre-filled with 192.168.181.150/20. Change the address or the prefix.

/20

Also accepts 192.168.1.130 255.255.255.192, 192.168.1.0 60 hosts or IPv6 like 2001:db8::/48.

Result

192.168.176.0/20

4,094 usable hosts

Network
192.168.176.0
First usable
192.168.176.1
Last usable
192.168.191.254
Broadcast
192.168.191.255
Subnet mask
255.255.240.0
Wildcard mask
0.0.15.255
Total addresses
4,096
PRIVATE

Inside 192.168.0.0/16, a private range (RFC 1918). Not routable on the public internet.

Binary view

Address · 192.168.181.150
11000000.10101000.10110101.10010110
Mask · 255.255.240.0
11111111.11111111.11110000.00000000
Network · 192.168.176.0
11000000.10101000.10110000.00000000

Bold bits are fixed for the network; orange bits number the hosts.

192.168.0.0/16 split into /20

  1. 192.168.176.0/20.176.1–.191.254 ◂

/20 next to /19 and /21

One bit shorter, a /19 (255.255.224.0) has 8,192 addresses and 8,190 usable, 4,096 more than a /20. One bit longer, /21 (255.255.248.0) has 2,048 addresses and 2,046 usable. /19 subnet · /21 subnet

Ask the calculator for a host count and it answers /20 for 2,047 to 4,094 hosts: typing "192.168.176.0 4,094 hosts" gives this size, one more host gives a /19.

Worked example

Take 192.168.181.150/20. The mask ends in the third octet. There the address is 181 = 10110101 and the mask 240 = 11110000; AND keeps the first 4 bits: 10110000 = 176. The octets after it become 0, so the network is 192.168.176.0. OR the wildcard 0.0.15.255 onto it to set every host bit: 192.168.191.255, the broadcast.

Devices use 192.168.176.1 through 192.168.191.254: 4,094 addresses. 192.168.181.150 is number 1,430 of them. In 192.168.0.0/16 this is subnet 12 of 16.

References

  • RFC 4632, Classless Inter-domain Routing (CIDR), §3.1: prefix lengths and block sizes.
  • RFC 950, Internet Standard Subnetting Procedure: subnet masks.
  • RFC 1878, Variable Length Subnet Table For IPv4, Table 1-1, with erratum 3147 (all-ones subnet rows).
  • RFC 1918, Address Allocation for Private Internets: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.

Other prefixes