Subnetting Cheat Sheet and Free Practice

Subnetting shows up all over the CompTIA Network+ exam, and the fastest way to answer those questions is to know a handful of CIDR prefixes cold. This cheat sheet gives you the CIDR-to-mask table, the formula for usable hosts, and the block-size shortcut that lets you find a subnet's network and broadcast address in seconds without binary math.

Then put it to work in the free practice tool below the table: a new random address every time, and the working shown after you check.

CIDR to subnet mask quick reference

CIDRSubnet maskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

Free subnetting practice

Work out the four values for this address, then check your answers. Unlimited problems, no signup.

Host address

10.152.226.154/26

Want scored sets that track your progress? The Subnetting Practice lab is one of CertiTom's Network+ PBQ labs.

The usable hosts formula

A subnet has 2^h addresses, where h is the number of host bits (32 minus the CIDR number). Two of those addresses are reserved: the first is the network address and the last is the broadcast address. So usable hosts = 2^h − 2.

Example: a /27 leaves 5 host bits. 2^5 = 32 addresses, minus 2 = 30 usable hosts.

The block-size shortcut

For any prefix in the last octet, the block size is 256 minus the mask's last octet. A /26 mask ends in .192, so the block size is 256 − 192 = 64, and the subnets start at .0, .64, .128, and .192.

To find which subnet an address belongs to, find the largest block multiple that is less than or equal to the host's last octet. For 192.168.1.70/26, the multiples of 64 are 0, 64, 128, 192, so the network is 192.168.1.64 and the broadcast is 192.168.1.127 (one less than the next block).

Private ranges and special addresses to know

  • 10.0.0.0/8, 172.16.0.0/12 (172.16 to 172.31), and 192.168.0.0/16 are the RFC 1918 private ranges.
  • 169.254.0.0/16 is APIPA: a host gives itself one of these when it can't reach a DHCP server.
  • 127.0.0.1 is the loopback address used to test the local TCP/IP stack.
  • A /30 (2 usable hosts) is the classic choice for a point-to-point link between two routers.

Try 3 free sample questions

Questions are visible below. Pick an answer to reveal the correct one and the explanation.

Q1.How many usable host addresses are in a /27 subnet?

Q2.Which subnet mask matches a /26 prefix?

Q3.A host has the address 192.168.1.70/26. What is its network address?

Test yourself

Try 10 exam-style questions on subnetting, with an explanation for every answer. Free, no signup.

Start the quiz

Practice this free on CertiTom

Create a free account to drill unlimited practice questions on this topic across A+, Network+, Security+, and CySA+. Pro members also get the hands-on Subnetting Practice performance-based lab (Network+) — drag-and-drop practice that mirrors the real exam.

Frequently asked questions

Why do you subtract 2 when counting usable hosts?

The first address in every subnet identifies the network itself and the last address is the broadcast address. Neither can be assigned to a host, so usable hosts equal 2^h minus 2, where h is the number of host bits.

What is the fastest way to subnet on the Network+ exam?

Memorize the masks for /24 through /30 and use the block-size shortcut: 256 minus the mask's interesting octet gives the block size, and subnets start at multiples of that number. This avoids binary math entirely for most exam questions.

Where can I practice subnetting for free?

Right on this page. The practice tool gives you a random host address and prefix, you work out the network address, broadcast address, subnet mask and usable hosts, and it checks your answers and shows the block-size working. It's free and unlimited, with no signup.

What subnet is best for a link between two routers?

A /30, which gives exactly 2 usable addresses, one for each router interface. Larger subnets would waste addresses on a link that only ever has two devices.