Practice subnetting without a chart: enter an IPv4 address and prefix, then reveal the interesting octet, increment, block, network, broadcast and usable range one step at a time, or test yourself on random questions.
This trainer walks through the no-chart method from Subnetting in Your Head: find the octet where the prefix ends, work out the block size there, and fill in the rest. Each step stays hidden until you've had a chance to work it out yourself. To get the answer straight away instead, use the IPv4 Subnet Calculator.
Your input stays in your browser. The working runs there, and what you type isn't sent to this site or anyone else, isn't saved, and isn't added to the page address. Your browser's own features, such as form autofill and extensions, are outside this site's control. On a shared computer, clear anything sensitive before you walk away.
This trainer needs JavaScript. Turn it on for this page to use it; the explanation below works without it.
Work it out step by step
Practice
Get a random address from a private (RFC 1918) or documentation (RFC 5737) range with a prefix from /9 to /30. Work out the network and broadcast addresses in your head, type them in, and check.
The method in four steps
- Find the interesting octet, the one the prefix ends in: /1 to /8 is the first octet, /9 to /16 the second, /17 to /24 the third and /25 to /32 the fourth. Octets before it are copied unchanged.
- Work out the increment: 2 to the power of the host bits left in that octet. For /20, 4 of its bits fall in the third octet, leaving 4 host bits there, so the increment is 24 = 16.
- Find the block: the largest multiple of the increment that isn't more than the octet's value is where the block starts; it ends one before the next multiple.
- Fill in the rest: zeros after the interesting octet give the network address; 255s give the broadcast address. The usable hosts sit between them.
The /8, /16, /24 and /32 prefixes end exactly on an octet boundary, so there's nothing to round: the increment in that octet is 1. The trainer also covers /0 (the default route), /31 (a point-to-point link with no broadcast address, RFC 3021) and /32 (one address).
Example: 172.23.23.18/22
- /22 ends in the third octet (/17 to /24). Copy 172.23.
- 22 − 16 = 6 bits fall in the third octet, leaving 2 host bits: the increment is 22 = 4.
- The third octet is 23. The largest multiple of 4 that isn't more than 23 is 20, so the block is 20 to 23.
- Network 172.23.20.0/22, broadcast 172.23.23.255, usable hosts 172.23.20.1 to 172.23.23.254 (1,022 of 1,024 addresses).
What the trainer accepts
The trainer reads input the same way as the IPv4 Subnet Calculator, so a typo can't quietly give you the wrong network: numbers above 255, leading zeros such as 010, masks whose 1 bits aren't contiguous, and stray characters are refused with an explanation.
Related reference
For the full explanation, with worked examples and common mistakes, read Subnetting in Your Head: The No-Chart Method. For a one-page summary to print, see the Mental Subnetting Cheatsheet. For Cisco ACL wildcards, use the Wildcard Mask Calculator. More networking guides are under Networking & Wi-Fi.
The method is inspired by an explanation by u/nivekami on r/ccna. This page is written independently and isn't endorsed by its author.
Standards and references
For how the IT Resource Center is researched, reviewed and corrected, see How These Guides Are Made.