tip
~/geeksubnet/masks/21

/21 subnet mask: 255.255.248.0

Every value on this page is reproducible in the calculator.

The /21 prefix means the first 21 bits of the address identify the network and the remaining 11 identify the host. Written out, the mask is 255.255.248.0, in binary 11111111.11111111.11111000.00000000, and its Cisco wildcard or inverse form is 0.0.7.255. It covers 2,048 addresses, of which 2,046 can be given to hosts.

/21 at a glance

CIDR prefix/21
Subnet mask255.255.248.0
Mask in binary11111111.11111111.11111000.00000000
Wildcard (inverse) mask0.0.7.255
Host bits11
Total addresses2,048
Usable hosts2,046
Block size (magic number)8 in octet 3

Every /21 inside 172.16.0.0/16

A 172.16.0.0/16 contains 32 subnets of /21. Here are the first 8, which is enough to see the pattern: each one starts 8 after the last in octet 3.

NetworkFirst hostLast hostBroadcast
172.16.0.0/21172.16.0.1172.16.7.254172.16.7.255
172.16.8.0/21172.16.8.1172.16.15.254172.16.15.255
172.16.16.0/21172.16.16.1172.16.23.254172.16.23.255
172.16.24.0/21172.16.24.1172.16.31.254172.16.31.255
172.16.32.0/21172.16.32.1172.16.39.254172.16.39.255
172.16.40.0/21172.16.40.1172.16.47.254172.16.47.255
172.16.48.0/21172.16.48.1172.16.55.254172.16.55.255
172.16.56.0/21172.16.56.1172.16.63.254172.16.63.255

The magic number for /21

Take the interesting octet of the mask, the one that is neither 255 nor 0. For /21 that is 248 in octet 3. Subtract it from 256:

256 - 248 = 8

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

Where a /21 shows up in practice

A /21 gives 2,046 usable addresses. It is the size reached for when a wireless guest network or a large DHCP scope has outgrown a /22 and nobody wants to renumber again in a year.

Frequently asked questions

How many hosts are in a /21?

A /21 holds 2,048 addresses in total. After reserving the network and broadcast addresses, 2,046 are usable by hosts.

What is the subnet mask for /21?

The /21 subnet mask is 255.255.248.0 in dotted-decimal notation.

What is the wildcard mask for /21?

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

What is /21 in binary?

The /21 mask written out bit by bit is 11111111.11111111.11111000.00000000: 21 ones followed by 11 zeros.

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