Our beginner networking students often describe IPv4 subnetting as the most difficult concept to grasp. It can certainly be confusing, but it is necessary for any entry-level networking certification. Mastering IPv4 subnetting will also make you more efficient in network administration and design.
With that, we hope our IPv4 subnetting cheat sheet will be a great reference for you in your studies and career.
Click to download a pdf copy here to keep with you, and when you’re ready, read on.
IPv4 Subnetting Cheat Sheet Search
Search our IPv4 Subnetting cheat sheet to find the right cheat for the term you're looking for. Simply enter the term in the search bar and you'll receive the matching cheats available.
IPv4 Subnets
Subnetting allows a computer/host to know if the machine it wants to talk to is local or outside of its network. The subnet mask determines how many IPv4 addresses can be assigned within a network.
CIDR | SUBNET MASK | OF ADDRESSES | WILDCARD |
---|---|---|---|
/32 | 255.255.255.255 | 1 | 0.0.0.0 |
/31 | 255.255.255.254 | 2 | 0.0.0.1 |
/30 | 255.255.255.252 | 4 | 0.0.0.3 |
/29 | 255.255.255.248 | 8 | 0.0.0.7 |
/28 | 255.255.255.240 | 16 | 0.0.0.15 |
/27 | 255.255.255.224 | 32 | 0.0.0.31 |
/26 | 255.255.255.192 | 64 | 0.0.0.63 |
/25 | 255.255.255.128 | 128 | 0.0.0.127 |
/24 | 255.255.255.0 | 256 | 0.0.0.255 |
/23 | 255.255.254.0 | 512 | 0.0.1.255 |
/22 | 255.255.252.0 | 1024 | 0.0.3.255 |
/21 | 255.255.248.0 | 2,048 | 0.0.7.255 |
/20 | 255.255.240.0 | 4,096 | 0.0.15.255 |
/19 | 255.255.224.0 | 8,192 | 0.0.31.255 |
/18 | 255.255.192.0 | 16,384 | 0.0.63.255 |
/17 | 255.255.128.0 | 32,768 | 0.0.127.255 |
/16 | 255.255.0.0 | 65,536 | 0.0.255.255 |
/15 | 255.254.0.0 | 131,072 | 0.1.255.255 |
/14 | 255.252.0.0 | 262,144 | 0.3.255.255 |
/13 | 255.248.0.0 | 524,288 | 0.7.255.255 |
/12 | 255.240.0.0 | 1,048,576 | 0.15.255.255 |
/11 | 255.224.0.0 | 2,097,152 | 0.31.255.255 |
/10 | 255.192.0.0 | 4,194,304 | 0.63.255.255 |
/9 | 255.128.0.0 | 8,388,608 | 0.127.255.255 |
/8 | 255.0.0.0 | 16,777,216 | 0.255.255.255 |
/7 | 254.0.0.0 | 33,554,432 | 1.255.255.255 |
/6 | 252.0.0.0 | 67,108,864 | 3.255.255.255 |
/5 | 248.0.0.0 | 134,217,728 | 7.255.255.255 |
/4 | 240.0.0.0 | 268,435,456 | 15.255.255.255 |
/3 | 224.0.0.0 | 536,870,912 | 31.255.255.255 |
/2 | 192.0.0.0 | 1,073,741,824 | 63.255.255.255 |
/1 | 128.0.0.0 | 2,147,483,648 | 127.255.255.255 |
/0 | 0.0.0.0 | 4,294,967,296 | 255.255.255.255 |
Decimal to Binary
While IPv4 addresses appear to be four sets of numbers separated by decimals, they are actually made up of 32 ones and zeros. Understanding this will assist you in setting up your networks and is required on both the CompTIA Network+ and Cisco Certified Network Associate exams.
SUBNET MASK | WILDCARD |
---|---|
255 1111 1111 | 0 0000 0000 |
254 1111 1110 | 1 0000 0001 |
252 1111 1100 | 3 0000 0011 |
248 1111 1000 | 7 0000 0111 |
240 1111 0000 | 15 0000 1111 |
224 1110 0000 | 31 0001 1111 |
192 1100 0000 | 63 0011 1111 |
128 1000 0000 | 127 0111 1111 |
0 0000 0000 | 255 1111 1111 |
Why Learn Binary?
Subnet masks determine which part of the IP address is for the network, and which is for the host. We can view this when examining the subnet mask in binary format. Any binary digit that is a “1” is for the network, while a “0” is for the host.
*Note that subnet masks can only be written with all ones followed by all zeros.*
The above example is called a /24 (pronounced whack 24) subnet because there are 24 binary digits in the “1” (or network) position. So, the first 24 binary digits (or three octets) of an IP range are for the network (non-changing), and the last eight binary digits (last octet) are for the hosts.
In this next example, our internet provider gave us an IP range of 199.44.6.0 with a /24 subnet, allowing 254 IP addresses.
*Remember that hosts cannot have an IP address that ends in the first or last number in the available range.*
Classful addressing will use the following subnet masks.
255.0.0.0/8
255.255.0.0/16
255.255.255.0/24
These are very easy to calculate.
But what if we want a /28 subnet mask, for instance?
In this example, our internet provider gave us a different subnet mask (/28). We see the first 28 binary digits are in the one position. They also gave us an IP range of 199.44.6.80.
How many hosts can we have now?
Why is this? We know the first four binary characters are part of the network, so cannot change. 01010000 converts to 80, our first IP in the range. We now look at all available combinations of the next four binary positions.
First Four | Fifth | Sixth | Seventh | Eighth | Decimal |
0101 | 0 | 0 | 0 | 1 | 81 |
0101 | 0 | 0 | 1 | 0 | 82 |
0101 | 0 | 0 | 1 | 1 | 83 |
0101 | 0 | 1 | 0 | 0 | 84 |
0101 | 0 | 1 | 0 | 1 | 85 |
0101 | 0 | 1 | 1 | 0 | 86 |
0101 | 0 | 1 | 1 | 1 | 87 |
0101 | 1 | 0 | 0 | 0 | 88 |
0101 | 1 | 0 | 0 | 1 | 89 |
0101 | 1 | 0 | 1 | 0 | 90 |
0101 | 1 | 0 | 1 | 1 | 91 |
0101 | 1 | 1 | 0 | 0 | 92 |
0101 | 1 | 1 | 0 | 1 | 93 |
0101 | 1 | 1 | 1 | 0 | 94 |
Without understanding decimal to binary, this would be a very difficult calculation.
IPv4 Address Classes
These were the first effort to divide network IDs and set how many public IPv4 addresses you can have.
A | 0.0.0.0 – 127.255.255.255 |
B | 128.0.0.0 – 191.255.255.255 |
C | 192.0.0.0 – 223.255.255.255 |
D | 224.0.0.0 – 239.255.255.255 |
E | 240.0.0.0 – 255.255.255.255 |
Reserved (Private) IP Ranges
These IP address ranges are reserved for internal networks. You will never see public IPv4 addresses in these ranges.
CLASS A | 10.0.0.0 – 10.255.255.255 |
CLASS B | 172.16.0.0 – 172.31.255.255 |
CLASS C | 192.168.0.0 – 192.168.255.255 |
LOCALHOST | 127.0.0.0 – 127.255.255.255 |
ZEROCONF (APIPA/BONJOUR) | 169.254.0.0 – 169.254.255.255 |
Terminology
If you want to discuss IPv4, you need to learn the following terms.
WILDCARD MASK | A wildcard mask indicates which parts of an IP address are available for examination. |
CIDR | Classless interdomain routing was developed to provide more granularity than legacy classful addressing; CIDR notation is expressed as /XX |
Conclusion
IPv4 subnetting can be confusing at first, but we promise with practice it will become second nature.
Want more help learning subnetting? Check out these courses in our Members Section.
Thank you!
You should add RFC 1918 address space to this list
Thank you Sir.
Thank you!
this is very useful.
Thank you for sharing useful resources !
These subnetting masks are really useful for IPv4 addresses.
Thank you.
Love this – thank you!
Thank you very much Nathan. Appreciate that.
My pleasure.
Thank you! This is a very useful cheatsheet.
Always great to have extra reference material.