Subnet Cheat Sheet: The Complete IPv4 Subnetting Guide, CIDR Table, Formulas & Examples

Subnet Cheat Sheet: The Complete IPv4 Subnetting Guide, CIDR Table, Formulas & Examples

Subnet Cheat Sheet: The Complete IPv4 Subnetting Guide, CIDR Table, Formulas & Examples

If you are learning networking, preparing for a certification, troubleshooting an IP network, or simply trying to understand why devices use addresses such as 192.168.1.25/24, this subnet cheat sheet gives you the practical answers in one place. Instead of memorizing disconnected formulas, you will learn how subnet masks, CIDR notation, network addresses, broadcast addresses, usable hosts, subnet ranges, and VLSM fit together. By the end, you should be able to look at an IPv4 address and prefix and quickly determine the network, host range, and broadcast address.

What Is Subnetting?

Subnetting is the process of dividing a larger IP network into smaller logical networks called subnets. Each subnet creates a separate address range that can be used for a particular group of devices, department, location, VLAN, or network segment.

A subnet cheat sheet is useful because subnetting involves several related calculations. You need to understand the IP address, subnet mask, CIDR prefix, number of borrowed bits, number of subnets, number of addresses, and usable host addresses.

For example, consider:

192.168.10.0/24

A /24 prefix means that 24 of the 32 IPv4 bits represent the network portion, leaving 8 bits for hosts. That gives 256 total addresses and, under traditional IPv4 host calculations, 254 usable host addresses.

If the same /24 network is divided into /26 subnets, four smaller networks are created, each containing 64 total addresses and normally 62 usable host addresses.

Subnetting therefore gives network administrators much greater control over address allocation.

The original Internet subnetting standard, RFC 950, described subnetting as a way to divide an existing network into logical subnets for administrative and technical reasons.

Why Subnetting Matters

Modern networks rarely benefit from placing every device into one enormous broadcast domain. A company might have separate networks for employees, guests, servers, voice systems, security devices, and management equipment.

Subnetting helps organizations structure those networks logically.

Imagine a company has been assigned 192.168.50.0/24. Instead of putting all 200-plus devices into one network, administrators could divide the address space into smaller ranges.

For example:

192.168.50.0/26 could serve employees.

192.168.50.64/26 could serve servers.

192.168.50.128/26 could serve voice devices.

192.168.50.192/26 could serve network management.

This arrangement makes IP addressing easier to manage and can support traffic segmentation, security policies, routing design, and troubleshooting.

The goal is not simply to create as many subnets as possible. Good subnetting creates appropriately sized networks without wasting address space.

Subnet Cheat Sheet: The Essential IPv4 Table

The following table is one of the most useful parts of any subnet cheat sheet because it lets you quickly identify the relationship between CIDR prefixes, subnet masks, total addresses, and usable hosts.

CIDRSubnet MaskTotal AddressesUsable Hosts*
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/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
/31255.255.255.2542Special point-to-point use
/32255.255.255.2551Single address

*For conventional IPv4 subnet calculations, the network and broadcast addresses are excluded from the usable-host count. /31 is a special case commonly used for point-to-point links.

CIDR notation provides a flexible way to represent IPv4 blocks using a prefix length from /0 through /32. RFC 4632 explains how classless prefixes replaced the rigid assumptions of older class-based addressing and allowed address blocks to be sized according to actual requirements.

Understanding IPv4 Addresses

An IPv4 address contains 32 binary bits divided into four 8-bit octets.

For example:

192.168.1.100

Each octet can contain a value from 0 through 255.

In binary, the address is:

11000000.10101000.00000001.01100100

The subnet mask determines which bits belong to the network and which belong to hosts.

For:

192.168.1.100/24

the first 24 bits represent the network portion, while the final 8 bits represent the host portion.

The equivalent subnet mask is:

255.255.255.0

Think of the prefix as a dividing line between the network and host portions.

A /24 means:

24 network bits + 8 host bits = 32 total bits.

A /26 means:

26 network bits + 6 host bits = 32 total bits.

That simple relationship is the foundation of IPv4 subnetting.

Subnet Mask vs. CIDR Notation

Two common ways to express the same network information are the dotted-decimal subnet mask and CIDR prefix.

For example:

192.168.1.0/24

is equivalent to:

192.168.1.0 255.255.255.0

Likewise:

192.168.1.0/26

is equivalent to:

192.168.1.0 255.255.255.192

CIDR notation is generally faster to read and write, which is why networking professionals frequently use it.

RFC 4632 specifically describes /16 as a prefix where 16 significant bits identify the network portion and /24 as a prefix where 24 bits identify it.

The Subnet Cheat Sheet Formula You Need Most

The most important host calculation is:

Total addresses = 2^host bits

Because IPv4 addresses contain 32 bits:

Host bits = 32 − prefix length

For a /24 network:

32 − 24 = 8 host bits

Therefore:

2⁸ = 256 total addresses.

For conventional subnets:

Usable hosts = 2^host bits − 2

So:

2⁸ − 2 = 254 usable hosts.

For a /26:

32 − 26 = 6 host bits

2⁶ = 64 total addresses

2⁶ − 2 = 62 usable hosts.

The two traditionally excluded addresses are the network address and broadcast address.

This formula is one of the most important entries in a practical subnet cheat sheet.

How to Calculate the Number of Subnets

Subnetting can also be approached from the opposite direction.

Suppose you start with a /24 network and need four equal-sized subnets.

You need enough borrowed bits to create at least four subnet combinations.

The formula is:

Number of subnets = 2^borrowed bits

One borrowed bit gives:

2¹ = 2 subnets.

Two borrowed bits give:

2² = 4 subnets.

Three borrowed bits give:

2³ = 8 subnets.

Therefore, borrowing two host bits from a /24 creates a /26.

The resulting networks are:

192.168.1.0/26

192.168.1.64/26

192.168.1.128/26

192.168.1.192/26

Each subnet has 64 total addresses and 62 conventional usable hosts.

The Magic Number Method

The “magic number” or block-size method is one of the fastest subnetting techniques for exams and real-world troubleshooting.

Suppose you have:

192.168.10.77/26

The subnet mask is:

255.255.255.192

The important octet is 192.

Calculate:

256 − 192 = 64

Therefore, the block size is 64.

The subnet boundaries are:

0

64

128

192

Now locate 77.

It falls between 64 and 127.

Therefore:

Network address: 192.168.10.64

Broadcast address: 192.168.10.127

Usable host range: 192.168.10.65 – 192.168.10.126

This method avoids converting the entire address into binary and is particularly useful when solving subnetting questions quickly.

Subnet Cheat Sheet for Common Prefixes

Here is a compact reference for the prefixes you are most likely to encounter.

/24

Mask: 255.255.255.0

Block size: 256

Total addresses: 256

Usable hosts: 254

Typical use: Small network or VLAN.

/25

Mask: 255.255.255.128

Block size: 128

Total addresses: 128

Usable hosts: 126

A /24 can be divided into two /25 networks.

/26

Mask: 255.255.255.192

Block size: 64

Total addresses: 64

Usable hosts: 62

A /24 can be divided into four /26 networks.

/27

Mask: 255.255.255.224

Block size: 32

Total addresses: 32

Usable hosts: 30

A /24 can be divided into eight /27 networks.

/28

Mask: 255.255.255.240

Block size: 16

Total addresses: 16

Usable hosts: 14

This size is useful for relatively small network segments.

/29

Mask: 255.255.255.248

Block size: 8

Total addresses: 8

Usable hosts: 6.

/30

Mask: 255.255.255.252

Block size: 4

Total addresses: 4

Traditional usable hosts: 2.

A /30 has historically been common for point-to-point IPv4 links, although /31 can be used in appropriate point-to-point environments.

A Complete Subnetting Example

Consider the address:

172.16.35.200/27

First determine the mask:

/27 = 255.255.255.224

Now calculate the block size:

256 − 224 = 32

The subnet boundaries are:

0, 32, 64, 96, 128, 160, 192, 224

The address 200 belongs to the 192–223 range.

Therefore:

Network: 172.16.35.192

First host: 172.16.35.193

Last host: 172.16.35.222

Broadcast: 172.16.35.223

Total addresses: 32

Usable hosts: 30

This is exactly the type of problem for which a subnet cheat sheet can dramatically reduce calculation time.

How to Find the Subnet Range Quickly

A reliable four-step process works for most IPv4 subnetting questions.

First, determine the CIDR prefix.

Second, convert the prefix into a subnet mask.

Third, identify the octet where the subnet mask is neither 255 nor 0.

Fourth, calculate the block size using:

256 − mask value

Then locate the IP address inside the correct block.

For example:

10.20.30.145/28

/28 = 255.255.255.240

Block size:

256 − 240 = 16

The ranges are:

0–15

16–31

32–47

48–63

64–79

80–95

96–111

112–127

128–143

144–159

Since 145 falls into 144–159:

Network = 10.20.30.144

First host = 10.20.30.145

Last host = 10.20.30.158

Broadcast = 10.20.30.159

Notice that the IP address itself is the first usable address in this example.

VLSM: Variable-Length Subnet Masking

Not every network needs the same number of hosts. This is where VLSM becomes valuable.

Suppose a company needs:

  • 100 host addresses for employees
  • 40 for a development team
  • 20 for management
  • 10 for a small office link

Creating four equal-sized networks could waste significant address space.

With VLSM, the administrator can allocate different prefix lengths.

For example:

100 hosts → /25

40 hosts → /26

20 hosts → /27

10 hosts → /28

This approach uses the available address space more efficiently.

VLSM and CIDR are closely related to modern classless network design, where prefixes can be selected according to actual addressing requirements rather than the old Class A, B, and C boundaries. RFC 4632 identifies flexible classless prefixes and aggregation as important parts of scalable Internet addressing.

Subnetting and Network Security

Subnetting is not a complete security solution, but it can contribute to a stronger network architecture.

For example, a business could place employee computers, servers, guest devices, and management interfaces into different subnets.

Firewalls or Layer 3 switches can then apply different routing and access-control policies between those networks.

A guest subnet might be allowed to reach the Internet but prevented from accessing internal servers.

A management subnet might be restricted to authorized administrators.

A server subnet might allow only specific application traffic.

The key point is that subnetting provides logical boundaries. Security controls determine what traffic can cross those boundaries.

Subnetting and VLANs

VLANs and subnets are related but are not the same thing.

A VLAN is a Layer 2 logical segmentation mechanism, while an IP subnet is a Layer 3 addressing concept.

In many enterprise networks, one VLAN is associated with one IP subnet, but the two concepts should not be treated as interchangeable.

For example:

VLAN 10 → 192.168.10.0/24

VLAN 20 → 192.168.20.0/24

VLAN 30 → 192.168.30.0/24

Routing between those subnets requires a Layer 3 device, such as a router or Layer 3 switch.

Understanding this distinction is important for network administrators and students preparing for networking certifications.

Expert Insight Into Subnetting

The original subnetting work emphasized flexibility in choosing how address bits were divided. In RFC 950, Jon Postel and John Mogul concluded that the address-mask approach offered flexibility in allocating bits between network, subnet, and host information. Their concise assessment was that it was “the most flexible scheme.”

That idea remains important today: subnetting is fundamentally about deciding how available address space should be divided to meet technical and organizational requirements.

Common Subnetting Mistakes

One of the most common mistakes is confusing total addresses with usable hosts.

A /27 contains 32 total addresses, not 32 conventional usable host addresses. In the traditional model, 30 are usable because the network and broadcast addresses are reserved.

Another common mistake is calculating the block size incorrectly.

For /27, the mask is 255.255.255.224, so:

256 − 224 = 32.

The block size is 32, not 224.

Students also sometimes assume that every IP address ending in .0 is a network address. That is incorrect. Whether .0 is a network address depends on the subnet boundary.

For example, with /26, the subnet boundaries can be .0, .64, .128, and .192.

With /27, they can be .0, .32, .64, .96, .128, .160, .192, and .224.

Another mistake is relying exclusively on old Class A, B, and C rules. Modern IPv4 networking uses CIDR and explicit prefix lengths. RFC 4632 documents the shift toward classless addressing and prefix-based allocation.

Mini Case Study: Designing a Small Office Network

Imagine a U.S. company receives the private network:

192.168.100.0/24

The organization has four departments and wants logical separation.

Rather than using the entire /24 for every device, the network administrator creates four /26 networks.

Marketing:

192.168.100.0/26

IT:

192.168.100.64/26

Finance:

192.168.100.128/26

Operations:

192.168.100.192/26

Each subnet has:

64 total addresses

62 conventional usable addresses

1 network address

1 broadcast address

This gives every department its own address range while keeping the design easy to understand and troubleshoot.

If the company later discovers that departments have very different sizes, VLSM could provide a more efficient design.

Subnet Cheat Sheet for Certification Exams

If you are studying for a networking certification, memorize these relationships rather than trying to memorize every possible subnet.

Prefix + host bits = 32

Total addresses = 2^host bits

Traditional usable hosts = 2^host bits − 2

Number of equal subnets = 2^borrowed bits

Block size = 256 − interesting-octet mask value

Also remember the most common masks:

/24 = 255.255.255.0

/25 = 255.255.255.128

/26 = 255.255.255.192

/27 = 255.255.255.224

/28 = 255.255.255.240

/29 = 255.255.255.248

/30 = 255.255.255.252

If these become automatic, most basic subnetting questions become much faster.

IPv4 Subnetting vs. IPv6

This subnet cheat sheet focuses primarily on IPv4 because IPv4 subnet calculations are commonly tested using dotted-decimal masks, host bits, broadcast addresses, and block sizes.

IPv6 uses 128-bit addresses and generally relies on prefix lengths rather than IPv4-style subnet masks.

For example:

2001:db8:1234:1::/64

The /64 identifies the first 64 bits as the network prefix.

IPv6 does not use IPv4’s traditional broadcast mechanism. Instead, IPv6 uses multicast and other mechanisms for local communication.

Therefore, do not blindly apply IPv4 subnetting rules to IPv6.

Frequently Asked Questions

What is a subnet cheat sheet used for?

A subnet cheat sheet provides quick reference information for CIDR prefixes, subnet masks, block sizes, total addresses, usable hosts, and subnet calculations. It is especially useful for network troubleshooting, certification study, and IP address planning.

How do I calculate usable hosts from a subnet mask?

Determine the number of host bits by subtracting the CIDR prefix from 32. Then calculate 2^host bits − 2 for the conventional IPv4 usable-host count.

For example, /26 leaves six host bits:

2^6 − 2 = 62 usable hosts.

Special cases such as /31 should be handled according to the networking environment and protocol requirements.

What is the difference between /24 and /26?

A /24 contains 256 IPv4 addresses and traditionally provides 254 usable host addresses.

A /26 contains 64 addresses and traditionally provides 62 usable hosts.

A /24 can therefore be divided into four equal /26 subnets.

What is the easiest way to calculate a subnet range?

The block-size method is usually one of the quickest approaches. Find the relevant subnet-mask octet and calculate:

256 − mask value

Then identify which block contains the IP address. The beginning of that block is the network address, while the end is the broadcast address.

Is subnetting the same as a VLAN?

No. A VLAN is primarily a Layer 2 segmentation concept, while a subnet is a Layer 3 IP addressing concept. They are often used together, but they are not identical.

Should I memorize a complete subnet table?

Memorizing the most common prefixes from /24 through /30 is helpful, especially for certification exams. However, understanding the underlying formulas is more valuable because it allows you to calculate unfamiliar prefixes rather than relying entirely on memorization.

Final Subnet Cheat Sheet

A strong understanding of subnetting comes from recognizing the relationship between CIDR notation, subnet masks, network bits, host bits, address ranges, and routing.

Remember the core formulas:

Host bits = 32 − prefix length

Total addresses = 2^host bits

Traditional usable hosts = 2^host bits − 2

Block size = 256 − subnet-mask value

For quick reference:

/24 → 256 addresses → 254 usable

/25 → 128 addresses → 126 usable

/26 → 64 addresses → 62 usable

/27 → 32 addresses → 30 usable

/28 → 16 addresses → 14 usable

/29 → 8 addresses → 6 usable

/30 → 4 addresses → 2 usable

The real value of a subnet cheat sheet is not simply memorizing numbers. It is learning a repeatable process that lets you calculate a network address, host range, broadcast address, and subnet capacity confidently.

Subnetting remains one of the foundational skills in networking because efficient address allocation supports scalable network architecture, routing, segmentation, and administration. The historical development from traditional subnetting to classless addressing also demonstrates why flexible prefix-based addressing became so important to the growth of the Internet.

Keep this subnet cheat sheet nearby while practicing CIDR and subnetting exercises, and use the formulas rather than guessing. With enough repetition, subnet calculations that initially seem complicated become quick, predictable, and almost automatic.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *