The Only IPv4 Subnetting Cheat Sheet You’ll Ever Need

IPv4 Subnet Cheat Sheet

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.


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.

255  1111 11110  0000 0000
254  1111 11101  0000 0001
252  1111 11003  0000 0011
248  1111 10007  0000 0111
240  1111 000015  0000 1111
224  1110 000031  0001 1111
192  1100 000063  0011 1111
128  1000 0000127  0111 1111
0  0000 0000255  1111 1111
IPv4 Subnet Cheat Sheet

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.*

Subnet mask

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 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.*

whack 24 example

Classful addressing will use the following subnet masks.

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 

How many hosts can we have now?

whack 28 example

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 FourFifthSixthSeventhEighthDecimal

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.

A0.0.0.0 –
B128.0.0.0 –
C192.0.0.0 –
D224.0.0.0 –
E240.0.0.0 –

Reserved (Private) IP Ranges

These IP address ranges are reserved for internal networks. You will never see public IPv4 addresses in these ranges.

CLASS A10.0.0.0 –
CLASS B172.16.0.0 –
CLASS C192.168.0.0 –
LOCALHOST127.0.0.0 –


If you want to discuss IPv4, you need to learn the following terms.

WILDCARD MASKA wildcard mask indicates which parts of an IP address are available for examination.
CIDRClassless interdomain routing was developed to provide more granularity
than legacy classful addressing; CIDR notation is expressed as /XX


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.

Frequently Asked Questions

Level Up in Cyber Security: Join Our Membership Today!

vip cta image
vip cta details
  • Nathan House

    Nathan House is the founder and CEO of StationX. He has over 25 years of experience in cyber security, where he has advised some of the largest companies in the world. Nathan is the author of the popular "The Complete Cyber Security Course", which has been taken by over half a million students in 195 countries. He is the winner of the AI "Cyber Security Educator of the Year 2020" award and finalist for Influencer of the year 2022.

  • Daniel says:

    Thank you!

  • WAK says:

    You should add RFC 1918 address space to this list

  • Waqas says:

    Thank you Sir.

  • Edwin says:

    Thank you!
    this is very useful.

  • Dai Son says:

    Thank you for sharing useful resources !

  • Alishia says:

    These subnetting masks are really useful for IPv4 addresses.

  • Thomas Kelly says:

    Love this – thank you!

  • Denzil says:

    Thank you very much Nathan. Appreciate that.

  • Will Pape says:

    Thank you! This is a very useful cheatsheet.

  • TWG63 says:

    Always great to have extra reference material.

  • >