Subnetting Practice, Calculator & Cheat Sheet

Practise subnetting until it's automatic: every problem is randomly generated, checked instantly and explained with the block-size method. Use the calculator to check your own work, and keep the cheat sheet open while you learn.

What's the fastest way to subnet?

Use the block-size method. Find the octet where the mask stops being 255 (the "interesting octet"), subtract that mask value from 256 to get the block size, and count up in blocks: the block your address falls in is the network address, the next block minus one is the broadcast, and everything between is usable. Usable hosts = 2^(32 − prefix) − 2.

On the live page: an unlimited practice drill (easy, medium and hard), a subnet calculator, and this cheat sheet.

Worked subnetting examples

192.168.10.77/26

  1. /26 = 255.255.255.192. The interesting octet is octet 4 (mask value 192).
  2. Block size = 256 − 192 = 64. Subnets in that octet start at 0, 64, 128, …
  3. 77 falls in the block starting at 64, so the network address is 192.168.10.64.
  4. The broadcast is one less than the next block: 192.168.10.127.
  5. Usable hosts run from 192.168.10.65 to 192.168.10.126: 2^6 − 2 = 62 hosts.

Network 192.168.10.64 · broadcast 192.168.10.127 · hosts 192.168.10.65–192.168.10.126 (62 usable)

192.168.141.219/26

  1. /26 = 255.255.255.192. The interesting octet is octet 4 (mask value 192).
  2. Block size = 256 − 192 = 64. Subnets in that octet start at 0, 64, 128, …
  3. 219 falls in the block starting at 192, so the network address is 192.168.141.192.
  4. The broadcast is one less than the next block: 192.168.141.255.
  5. Usable hosts run from 192.168.141.193 to 192.168.141.254: 2^6 − 2 = 62 hosts.

Network 192.168.141.192 · broadcast 192.168.141.255 · hosts 192.168.141.193–192.168.141.254 (62 usable)

192.168.60.186/26

  1. /26 = 255.255.255.192. The interesting octet is octet 4 (mask value 192).
  2. Block size = 256 − 192 = 64. Subnets in that octet start at 0, 64, 128, …
  3. 186 falls in the block starting at 128, so the network address is 192.168.60.128.
  4. The broadcast is one less than the next block: 192.168.60.191.
  5. Usable hosts run from 192.168.60.129 to 192.168.60.190: 2^6 − 2 = 62 hosts.

Network 192.168.60.128 · broadcast 192.168.60.191 · hosts 192.168.60.129–192.168.60.190 (62 usable)

172.20.249.198/25

  1. /25 = 255.255.255.128. The interesting octet is octet 4 (mask value 128).
  2. Block size = 256 − 128 = 128. Subnets in that octet start at 0, 128, 256, …
  3. 198 falls in the block starting at 128, so the network address is 172.20.249.128.
  4. The broadcast is one less than the next block: 172.20.249.255.
  5. Usable hosts run from 172.20.249.129 to 172.20.249.254: 2^7 − 2 = 126 hosts.

Network 172.20.249.128 · broadcast 172.20.249.255 · hosts 172.20.249.129–172.20.249.254 (126 usable)

192.168.133.27/27

  1. /27 = 255.255.255.224. The interesting octet is octet 4 (mask value 224).
  2. Block size = 256 − 224 = 32. Subnets in that octet start at 0, 32, 64, …
  3. 27 falls in the block starting at 0, so the network address is 192.168.133.0.
  4. The broadcast is one less than the next block: 192.168.133.31.
  5. Usable hosts run from 192.168.133.1 to 192.168.133.30: 2^5 − 2 = 30 hosts.

Network 192.168.133.0 · broadcast 192.168.133.31 · hosts 192.168.133.1–192.168.133.30 (30 usable)

Subnetting cheat sheet (/8 to /32)

PrefixSubnet maskWildcardAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122 (point-to-point, RFC 3021)
/32255.255.255.2550.0.0.011 (host route)

Powers of 2

2^1 = 2 · 2^2 = 4 · 2^3 = 8 · 2^4 = 16 · 2^5 = 32 · 2^6 = 64 · 2^7 = 128 · 2^8 = 256 · 2^9 = 512 · 2^10 = 1,024 · 2^11 = 2,048 · 2^12 = 4,096

Special ranges

Subnetting: frequently asked questions

What's the fastest way to subnet?

Use the block-size method. Find the octet where the mask stops being 255 (the "interesting octet"), subtract that mask value from 256 to get the block size, and count up in blocks: the block your address falls in is the network address, the next block minus one is the broadcast, and everything between is usable. Usable hosts = 2^(32 − prefix) − 2.

How many usable hosts are in a /26?

62. A /26 has 2^(32 − 26) = 64 addresses; subtract the network and broadcast addresses to get 62 usable hosts. The mask is 255.255.255.192 and the block size is 64.

How do I find the network and broadcast address?

Work out the block size in the interesting octet (256 minus the mask value there). The network address is the multiple of the block size at or below your address; the broadcast is the next multiple minus one.

What subnet mask do I need for N hosts?

Pick the smallest prefix where 2^(32 − prefix) − 2 is at least N. For 50 hosts that's a /26 (62 hosts); for 500 hosts, a /23 (510 hosts).

Is subnetting on the CCNA, Network+ and A+ exams?

Yes. CCNA and Network+ both expect you to subnet quickly and accurately, including choosing masks for host counts and identifying network, broadcast and host ranges. A+ covers IP addressing basics, including private ranges and APIPA.

Does a /31 have usable hosts?

On point-to-point links, yes: RFC 3021 lets both addresses of a /31 be used, which saves addresses on router links. Exam questions that ask for usable hosts with the classic formula usually expect /30 for a two-host link.

Put subnetting to work