With this IP subnetting and CIDR cheat sheet article, we’ll provide you with all the details and show you how to subnet IP addresses, which are essential for network-related interviews, jobs, and exams.
Understanding how subnetting works may seem difficult initially, but it begins to make sense as you continue. You can quickly create and deploy IP subnets that will give your organization the necessary level of design ease, scalability, management, and security you need.
Quick IPv4 CIDR to Subnet Mask Table (copy or download PDF)
Use this compact table for a fast lookup of prefix length, subnet mask, total addresses, usable hosts, wildcard mask, and an example network. The full infographic and PDF download are available just below.
| Prefix | Subnet mask | Total addresses | Usable hosts* | Wildcard mask | Example network |
|---|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | 0.255.255.255 | 10.0.0.0/8 |
| /16 | 255.255.0.0 | 65,536 | 65,534 | 0.0.255.255 | 172.16.0.0/16 |
| /24 | 255.255.255.0 | 256 | 254 | 0.0.0.255 | 192.168.1.0/24 |
| /25 | 255.255.255.128 | 128 | 126 | 0.0.0.127 | 192.168.1.0/25 |
| /26 | 255.255.255.192 | 64 | 62 | 0.0.0.63 | 192.168.1.0/26 |
| /27 | 255.255.255.224 | 32 | 30 | 0.0.0.31 | 192.168.1.0/27 |
| /28 | 255.255.255.240 | 16 | 14 | 0.0.0.15 | 192.168.1.0/28 |
| /29 | 255.255.255.248 | 8 | 6 | 0.0.0.7 | 192.168.1.0/29 |
| /30 | 255.255.255.252 | 4 | 2 | 0.0.0.3 | 192.168.1.0/30 |
| /31 | 255.255.255.254 | 2 | 2** | 0.0.0.1 | 192.168.1.0/31 |
| /32 | 255.255.255.255 | 1 | 0** | 0.0.0.0 | 192.168.1.1/32 |
* Usable hosts = 2^(32−prefix) − 2 for most subnets.
** /31 on point‑to‑point links provides two usable interface addresses (no network/broadcast). /32 represents a single host route.
Download the free PDF cheat sheet using the form below the infographic, or keep scrolling for explanations, examples, and special-use ranges.
IP Subnetting Cheat Sheet Infographic PDF

I hope you have downloaded the subnet cheat sheet PDF; let’s first understand a few basic things before diving into the nitty-gritty of subnetting.
What is IP subnetting, and why do we need it?
IP Subnetting splits a network into multiple sub-networks, creating a partition based upon a consecutive block of IPv4 addresses, further represented by an IP address and the subnet mask.
Subnetting is widely used to conserve addresses and design scalable, manageable, and secure networks.
More on this later; let’s first understand IP addresses and other important concepts related to subnetting.
What is an IP address?

An IPv4 address is a 32‑bit logical identifier assigned to a host or interface at the Internet layer. It does not represent a physical location; it represents addressing used for routing and delivery.
- It is a 32‑bit number usually shown in dotted‑decimal notation.
- Periods create four octets; each octet holds 8 bits (1 byte), and 8 × 4 = 32 bits total.
- Common delivery types include unicast (one device), multicast (one‑to‑many group), broadcast (one‑to‑all on a subnet), and anycast (multiple devices share the same address; traffic is routed to the nearest instance).
What is a subnet mask?
The subnet mask divides the IP address into the network portion and the host portion, defining which bits identify the network and which identify the interface on that network.
An IP address and a subnet mask provide complete addressing information to any device connecting to the network. Both are 32 bits and split into four octets of 8 bits each.
For example: 192.168.100.1 255.255.255.0
Here, 192.168.100.1 is the IP address, and 255.255.255.0 is the subnet mask.
When you put the IP address and the subnet mask together, you can separate the network and host parts of the address. With subnet mask 255.255.255.0, the network address is 192.168.100.0. The host portion for a device using 192.168.100.1 is 0.0.0.1, and the full usable host range on this subnet is 192.168.100.1–192.168.100.254 (network = 192.168.100.0, broadcast = 192.168.100.255).
What is Classless and Classful IP addressing, and what is the difference?
IPv4 addresses were initially intended to be classful—ranging from Class A to Class E. Unicast IPv4 addresses can be divided into two parts: the network portion and the host ID portion of the address. Please check the table below.
Classful IP addressing worked within the above-defined classes and was an old way of assigning IP addresses and subnets to a network.
As the Internet grew, this restricted assignment of IP addresses became a bottleneck. As a result, a more flexible and practical approach, called Classless IP Addressing, was developed.
What is the difference between Private and Public IP addresses?
- Private IP addresses, sometimes called internal IP addresses, are meant to be used on private networks and should not be routed on the Internet.
- Public IP addresses are globally routable on the Internet. You can check your public address by searching “what is my address.”
- RFC 1918 private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
- Special-use IPv4 ranges (commonly encountered):
- CGNAT shared address space: 100.64.0.0/10 — used by providers for carrier-grade NAT; not globally routable.
- Link‑local: 169.254.0.0/16 — self-assigned for local link communication when no DHCP is available.
- Loopback: 127.0.0.0/8 — local host testing; never leaves the device.
- Multicast: 224.0.0.0/4 — group communication; not forwarded like unicast.
What is CIDR notation, and why do we use it?
IETF created Classless Interdomain Routing (CIDR) to provide greater granularity than classful routing; the CIDR notation is /XX.
It is also an efficient method for allocating IP subnets without class boundaries, which lowered the rate at which IPv4 addresses were depleted and helped grow the Internet rapidly.
For example: Instead of writing the IP address with a subnet mask, 192.168.100.0 255.255.255.0, we can write 192.168.100.0/24.
What are CIDR Blocks?

CIDR blocks are made up of addresses with the same prefix and the same number of bits. With the help of supernetting, you can combine adjacent CIDR blocks into a bigger routing aggregate with a shared network prefix.
The length of the prefix determines the size of the CIDR blocks. Using a shorter prefix, for example, 10.0.0.0/8, more addresses (about 16 million) can be allocated, resulting in a bigger block. On the other hand, a longer prefix, for example, 192.168.100.200/29, represents a smaller block with 8 total addresses (6 usable).
The Internet Assigned Numbers Authority (IANA) allocates large blocks to the Regional Internet Registries (RIRs) serving regions such as North America, Africa, and Europe.
Once an RIR obtains a CIDR block from IANA, it divides it into smaller pieces to distribute to Local Internet Registries (LIRs) — typically ISPs — which further assign blocks to end users based on need.
Organizations using multiple ISPs may receive provider‑independent blocks directly from an RIR or LIR; most end users receive provider‑assigned blocks from their ISP.
What is VLSM, and why do we use it?
With VLSM, you can divide an IP address space into subnets of different sizes. CIDR relies on VLSM to create efficient routes.
Quick Tip: Before choosing a routing protocol, check if the protocol supports VLSM. Classless protocols such as RIPv2, OSPF, IS‑IS, EIGRP, and BGP support VLSM/CIDR. Classful protocols like RIPv1 and IGRP do not and are considered legacy/obsolete.
How to convert Binary to Decimal and Decimal to Binary?
IPv4 addresses are represented in dotted decimal for human readability. Machines operate on the underlying binary values, so it helps to know how to convert between binary and decimal.
Example: Convert Binary 11011011 into Decimal.

Please refer to the handy table for Binary to Decimal and Decimal to Binary conversion.
Binary1 means the bit is ON | Decimal |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 10 | 2 |
| 11 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
| 1010 | 10 |
| 1011 | 11 |
| 1100 | 12 |
| 1101 | 13 |
| 1110 | 14 |
| 1111 | 15 |
| 10000 | 16 |
| 10001 | 17 |
| 10010 | 18 |
| 10011 | 19 |
| 10100 | 20 |
| 10101 | 21 |
| 10110 | 22 |
| 10111 | 23 |
| 11000 | 24 |
| 11001 | 25 |
| 11010 | 26 |
| 11011 | 27 |
| 11100 | 28 |
| 11101 | 29 |
| 11110 | 30 |
| 11111 | 31 |
| 100000 | 32 |
| 1000000 | 64 |
| 10000000 | 128 |
| 100000000 | 256 |
IP Subnetting Cheat Sheet with CIDR Cheat Sheet
Now that we know the basics of IP addressing and subnetting, let’s put it all together in an IP subnetting cheat sheet for quick reference.
The formula for usable IPv4 hosts in most subnets is 2^(32−prefix) − 2 because the first address is the network and the last is the broadcast. Exceptions: /31 on point‑to‑point links has two usable interface addresses and no network/broadcast; /32 represents a single host route (no usable host pool).
| CIDR Notation | Subnet Mask | Total Number of Networks | Formula Used for Usable Hosts= 2^(32 - Network Bits) - 2 | Wildcard Mask |
|---|---|---|---|---|
| /0 | 0.0.0.0 | 0 | 2^(32-0) - 2 = 2^32 - 2= 4,294,967,294 | 255.255.255.255 |
| /1 | 128.0.0.0 | 1 | 2^(32-1) - 2 = 2^31 - 2 = 2,147,483,646 | 127.255.255.255 |
| /2 | 192.0.0.0 | 2 | 2^(32-2) - 2 = 2^30 - 2 = 1,073,741,822 | 63.255.255.255 |
| /3 | 224.0.0.0 | 3 | 2^(32-3) - 2 = 2^29 - 2 = 536,870,910 | 31.255.255.255 |
| /4 | 240.0.0.0 | 4 | 2^(32-4) - 2 = 2^28 - 2 = 268,435,454 | 15.255.255.255 |
| /5 | 248.0.0.0 | 5 | 2^(32-5) - 2 = 2^27 - 2 = 134,217,726 | 7.255.255.255 |
| /6 | 252.0.0.0 | 6 | 2^(32-6) - 2 = 2^26 - 2 = 67,108,862 | 3.255.255.255 |
| /7 | 254.0.0.0 | 7 | 2^(32-7) - 2 = 2^25 - 2 = 33,554,430 | 1.255.255.255 |
| /8 | 255.0.0.0 | 8 | 2^(32-8) - 2 = 2^24 - 2 = 16,777,214 | 0.255.255.255 |
| /9 | 255.128.0.0 | 9 | 2^(32-9) - 2 = 2^23 - 2 = 8,388,606 | 0.127.255.255 |
| /10 | 255.192.0.0 | 10 | 2^(32-10) - 2 = 2^22 - 2 = 4,194,302 | 0.63.255.255 |
| /11 | 255.224.0.0 | 11 | 2^(32-11) - 2 = 2^21 - 2 = 2,097,150 | 0.31.255.255 |
| /12 | 255.240.0.0 | 12 | 2^(32-12) - 2 = 2^20 - 2 = 1,048,574 | 0.15.255.255 |
| /13 | 255.248.0.0 | 13 | 2^(32-13) - 2 = 2^19 - 2 = 524,286 | 0.7.255.255 |
| /14 | 255.252.0.0 | 14 | 2^(32-14) - 2 = 2^18 - 2 = 262,142 | 0.3.255.255 |
| /15 | 255.254.0.0 | 15 | 2^(32-15) - 2 = 2^17 - 2 = 131,070 | 0.1.255.255 |
| /16 | 255.255.0.0 | 16 | 2^(32-16) - 2 = 2^16 - 2 = 65,534 | 0.0.255.255 |
| /17 | 255.255.128.0 | 17 | 2^(32-17) - 2 = 2^15 - 2 = 32,766 | 0.0.127.255 |
| /18 | 255.255.192.0 | 18 | 2^(32-18) - 2 = 2^14 - 2 = 16,382 | 0.0.63.255 |
| /19 | 255.255.224.0 | 19 | 2^(32-19) - 2 = 2^13 - 2 = 8,190 | 0.0.31.255 |
| /20 | 255.255.240.0 | 20 | 2^(32-20) - 2 = 2^12 - 2 = 4,094 | 0.0.15.255 |
| /21 | 255.255.248.0 | 21 | 2^(32-21) - 2 = 2^11 - 2 = 2,046 | 0.0.7.255 |
| /22 | 255.255.252.0 | 22 | 2^(32-22) - 2 = 2^10 - 2 = 1,022 | 0.0.3.255 |
| /23 | 255.255.254.0 | 23 | 2^(32-23) - 2 = 2^9 - 2 = 510 | 0.0.1.255 |
| /24 | 255.255.255.0 | 24 | 2^(32-24) - 2 = 2^8 - 2 = 254 | 0.0.0.255 |
| /25 | 255.255.255.128 | 25 | 2^(32-25) - 2 = 2^7 - 2 = 126 | 0.0.0.127 |
| /26 | 255.255.255.192 | 26 | 2^(32-26) - 2 = 2^6 - 2 = 62 | 0.0.0.63 |
| /27 | 255.255.255.224 | 27 | 2^(32-27) - 2 = 2^5 - 2 = 30 | 0.0.0.31 |
| /28 | 255.255.255.240 | 28 | 2^(32-28) - 2 = 2^4 - 2 = 14 | 0.0.0.15 |
| /29 | 255.255.255.248 | 29 | 2^(32-29) - 2 = 2^3 - 2 = 6 | 0.0.0.7 |
| /30 | 255.255.255.252 | 30 | 2^(32-30) - 2 = 2^2 - 2 = 2 | 0.0.0.3 |
| /31 | 255.255.255.254 | 31 | Total number of Hosts = 2 | 0.0.0.1 |
| /32 | 255.255.255.255 | 32 | Total number of Hosts = 1 | 0.0.0.0 |
Let’s put it all together
Let’s take an example of the network configuration of your computer.

Let’s understand the main things here.
- The IPv4 address of this computer is 192.168.2.15.
- The Subnet Mask (prefix length) is 255.255.255.0.
- 192.168.2.15 is from the private IP address range.
- You can also write the above IP address and subnet mask in CIDR notation as 192.168.2.15/24.
- The default gateway (usually your home Wi‑Fi router) is 192.168.2.1.
- Line up the IP address and subnet mask and convert decimal numbers to binary:
- 11000000.10101000.00000010.00001111 = IP address (192.168.2.15)
- 11111111.11111111.11111111.00000000 = Subnet mask (255.255.255.0)
- The first three octets (24 bits) make up the network portion, and the last octet (8 bits) makes up the host portion:
- 11000000.10101000.00000010.00000000 = Network address (192.168.2.0)
- 00000000.00000000.00000000.00001111 = Host portion (0.0.0.15)
- The network address is 192.168.2.0; the broadcast address is 192.168.2.255; the usable host range is 192.168.2.1–192.168.2.254.
- When a packet with destination 192.168.2.15 arrives on the 192.168.2.0/24 subnet, your computer will receive and process it.
IPv4 Subnetting FAQ
- How many hosts are in a /29? 6 usable hosts (8 total addresses, minus network and broadcast).
- What is /31 used for? Point‑to‑point links; both addresses are usable, with no network/broadcast.
- What is a wildcard mask? The inverse of a subnet mask (e.g., 255.255.255.0 → 0.0.0.255) used in ACLs and matching rules.
- What are the RFC 1918 private ranges? 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
- What is CGNAT 100.64.0.0/10? Shared address space used by providers for carrier‑grade NAT; not routable on the Internet.
Conclusion
In conclusion, this IP Subnetting Cheat Sheet is a quick reference to subnetting. It includes an introduction to IP addressing, subnetting, IP subnets, classful/classless addressing, CIDR, Binary↔Decimal conversions, and a copyable CIDR table with /31 and /32 behavior clarified.
I hope you have found this article useful! Please share it with others who you think might benefit from it. Let me know your thoughts in the comments below.
- Telecom Network Infrastructure: Complete Guide to Components & Design - January 6, 2026
- TP-Link TL-SG108E vs Netgear GS308E: Budget Smart Switches - January 5, 2026
- MikroTik CRS305-1G-4S+ Review: The Ultimate Budget SFP+ Switch Guide - December 25, 2025



