Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (2024)

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (1)

As a developer or network engineer, you may need to occasionally look up subnet mask values and figure out what they mean.

To make your life easier, the freeCodeCamp community has made this simple cheat sheet. Just scroll or use Ctrl/Cmd + f to find the value you're looking for.

Here are the charts, followed by some explanations of what they mean.

CIDRSubnet maskWildcard mask# of IP addresses# of usable IP addresses
/32255.255.255.2550.0.0.011
/31255.255.255.2540.0.0.122*
/30255.255.255.2520.0.0.342
/29255.255.255.2480.0.0.786
/28255.255.255.2400.0.0.151614
/27255.255.255.2240.0.0.313230
/26255.255.255.1920.0.0.636462
/25255.255.255.1280.0.0.127128126
/24255.255.255.00.0.0.255256254
/23255.255.254.00.0.1.255512510
/22255.255.252.00.0.3.2551,0241,022
/21255.255.248.00.0.7.2552,0482,046
/20255.255.240.00.0.15.2554,0964,094
/19255.255.224.00.0.31.2558,1928,190
/18255.255.192.00.0.63.25516,38416,382
/17255.255.128.00.0.127.25532,76832,766
/16255.255.0.00.0.255.25565,53665,534
/15255.254.0.00.1.255.255131,072131,070
/14255.252.0.00.3.255.255262,144262,142
/13255.248.0.00.7.255.255524,288524,286
/12255.240.0.00.15.255.2551,048,5761,048,574
/11255.224.0.00.31.255.2552,097,1522,097,150
/10255.192.0.00.63.255.2554,194,3044,194,302
/9255.128.0.00.127.255.2558,388,6088,388,606
/8255.0.0.00.255.255.25516,777,21616,777,214
/7254.0.0.01.255.255.25533,554,43233,554,430
/6252.0.0.03.255.255.25567,108,86467,108,862
/5248.0.0.07.255.255.255134,217,728134,217,726
/4240.0.0.015.255.255.255268,435,456268,435,454
/3224.0.0.031.255.255.255536,870,912536,870,910
/2192.0.0.063.255.255.2551,073,741,8241,073,741,822
/1128.0.0.0127.255.255.2552,147,483,6482,147,483,646
/00.0.0.0255.255.255.2554,294,967,2964,294,967,294

* /31 is a special case detailed in RFC 3021 where networks with this type of subnet mask can assign two IP addresses as a point-to-point link.

And here's a table of the decimal to binary conversions for subnet mask and wildcard octets:

Subnet MaskWildcard
00000000025511111111
1281000000012701111111
192110000006300111111
224111000003100011111
240111100001500001111
24811111000700000111
25211111100300000011
25411111110100000001
25511111111000000000

Note that the wildcard is just the inverse of the subnet mask.

If you are new to network engineering, you can get a better idea of how computer networks work here.

Finally, this cheat sheet and the rest of the article is focused on IPv4 addresses, not the newer IPv6 protocol. If you'd like to learn more about IPv6, check out the article on computer networks above.

How Do IP Address Blocks Work?

IPv4 addresses like 192.168.0.1 are really just decimal representations of four binary blocks.

Each block is 8 bits, and represents numbers from 0-255. Because the blocks are groups of 8 bits, each block is known as an octet. And since there are four blocks of 8 bits, every IPv4 address is 32 bits.

For example, here's what the IP address 172.16.254.1 looks like in binary:

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (2)

To convert an IP address between its decimal and binary forms, you can use this chart:

1286432168421
xxxxxxxx

The chart above represents one 8 bit octive.

Now lets say you want to convert the IP address 168.210.225.206. All you need to do is break the address into four blocks (168, 210, 225, and 206), and convert each into binary using the chart above.

Remember that in binary, 1 is the equivalent to "on" and 0 is "off". So to convert the first block, 168, into binary, just start from the beginning of the chart and place a 1 or 0 in that cell until you get a sum of 168.

For example:

1286432168421
10101000

128 + 32 + 8 = 168, which in binary is 10101000.

If you do this for the rest of the blocks, you'd get 10101000.11010010.11100001.11001110.

What is Subnetting?

If you look at the table above, it can seem like the number of IP addresses is practically unlimited. After all, there are almost 4.2 billion possible IPv4 addresses available.

But if you think about how much the internet has grown, and how many more devices are connected these days, it might not surprise you to hear that there's already a shortage of IPv4 addresses.

Because the shortage was recognized years ago, developers came up with a way to split up an IP address into smaller networks called subnets.

This process, called subnetting, uses the host section of the IP address to break it down into those smaller networks or subnets.

Generally, an IP address is made up of network bits and host bits:

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (3)

So generally, subnetting does two things: it gives us a way to break up networks into subnets, and allows devices to determine whether another device/IP address is on the same local network or not.

A good way to think about subnetting is to picture your wireless network at home.

Without subnetting, every internet connected device would need its own unique IP address.

But since you have a wireless router, you just need one IP address for your router. This public or external IP address is usually handled automatically, and is assigned by your internet service provider (ISP).

Then every device connected to that router has its own private or internal IP address:

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (4)

Now if your device with the internal IP address 192.168.1.101 wants to communicate with another device, it'll use the IP address of the other device and the subnet mask.

The combination of the IP addresses and subnet mask allows the device at 192.168.1.101 to figure out if the other device is on the same network (like the device at 192.168.1.103), or on a completely different network somewhere else online.

Interestingly, the external IP address assigned to your router by your ISP is probably part of a subnet, which might include many other IP addresses for nearby homes or businesses. And just like internal IP addresses, it also needs a subnet mask to work.

How Subnet Masks Work

Subnet masks function as a sort of filter for an IP address. With a subnet mask, devices can look at an IP address, and figure out which parts are the network bits and which are the host bits.

Then using those things, it can figure out the best way for those devices to communicate.

If you've poked around the network settings on your router or computer, you've likely seen this number: 255.255.255.0.

If so, you've seen a very common subnet mask for simple home networks.

Like IPv4 addresses, subnet masks are 32 bits. And just like converting an IP address into binary, you can do the same thing with a subnet mask.

For example, here's our chart from earlier:

1286432168421
xxxxxxxx

Now let's convert the first octet, 255:

1286432168421
11111111

Pretty simple, right? So any octet that's 255 is just 11111111 in binary. This means that 255.255.255.0 is really 11111111.11111111.11111111.00000000 in binary.

Now let's look at a subnet mask and IP address together and calculate which parts of the IP address are the network bits and host bits.

Here are the two in both decimal and binary:

TypeDecimalBinary
IP address192.168.0.10111000000.10101000.00000000.01100101
Subnet mask255.255.255.011111111.11111111.11111111.00000000

With the two laid out like this, it's easy to separate 192.168.0.101 into network bits and host bits.

Whenever a bit in a binary subnet mask is 1, then the same bit in a binary IP address is part of the network, not the host.

Since the octet 255 is 11111111 in binary, that whole octet in the IP address is part of the network. So the first three octets, 192.168.0, is the network portion of the IP address, and 101 is the host portion.

In other words, if the device at 192.168.0.101 wants to communicate with another device, using the subnet mask it knows that anything with the IP address 192.168.0.xxx is on the same local network.

Another way to express this is with a network ID, which is just the network portion of the IP address. So the network ID of the address 192.168.0.101 with a subnet mask of 255.255.255.0 is 192.168.0.0.

And it's the same for the other devices on the local network (192.168.0.102, 192.168.0.103, and so on).

What Does CIDR Mean and What is CIDR Notation?

CIDR stands for Classless Inter-Domain Routing, and is used in IPv4, and more recently, IPv6 routing.

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (5)

CIDR was introduced in 1993 as a way to slow the usage of IPv4 addresses, which were quickly being exhausted under the older Classful IP addressing system that the internet was first built on.

CIDR encompasses a couple of major concepts.

The first is Variable Length Submasking (VLSM), which basically allowed network engineers to create subnets within subnets. And those subnets could be different sizes, so there would be fewer unused IP addresses.

The second major concept CIDR introduced is CIDR notation.

CIDR notation is really just shorthand for the subnet mask, and represents the number of bits available to the IP address. For instance, the /24 in 192.168.0.101/24 is equivalent to the IP address 192.168.0.101 and the subnet mask 255.255.255.0.

How to Calculate CIDR Noation

To figure out the CIDR notation for a given subnet mask, all you need to do is convert the subnet mask into binary, then count the number of ones or "on" digits. For example:

TypeDecimalBinary
Subnet mask255.255.255.011111111.11111111.11111111.00000000

Because there's three octets of ones, there are 24 "on" bits meaning that the CIDR notation is /24.

You can write it either way, but I'm sure you'll agree that /24 is a whole lot easier to write than 255.255.255.0.

This is usually done with an IP address, so let's take a look at the same subnet mask with an IP address:

TypeDecimalBinary
IP address192.168.0.10111000000.10101000.00000000.01100101
Subnet mask255.255.255.011111111.11111111.11111111.00000000

The first three octets of the subnet mask are all "on" bits, so that means that the same three octets in the IP address are all network bits.

Let's take a look at the last forth octet in a bit more detail:

TypeDecimalBinary
IP address10101100101
Subnet mask000000000

In this case, because all the bits for this octet in the subnet mask are "off", we can be certain that all of the corresponding bits for this octet in the IP address are part of the host.

When you write CIDR notation it's usually done with the network ID. So the CIDR notation of the IP address 192.168.0.101 with a subnet mask of 255.255.255.0 is 192.168.0.0/24.

To see more examples of how to calculate the CIDR notation and network ID for a given IP address and subnet mask, check out this video:

Classful IP Addressing

Now that we've gone over some basic examples of subnetting and CIDR, let's zoom out and look at what's known as Classful IP addressing.

Back before subnetting was developed, all IP addresses fell into a particular class:

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (6)

Note that there are class D and E IP addresses, but we'll go into these in more detail a bit later.

Classful IP addresses gave network engineers a way to provide different organizations with a range of valid IP addresses.

There were a lot of issues with this approach that eventually lead to subnetting. But before we get into those, let's take a closer look at the different classes.

Class A IP Addresses

For Class A IP addresses, the first octet (8 bits / 1 byte) represent the network ID, and the remaining three octets (24 bits / 3 bytes) are the host ID.

Class A IP addresses range from 1.0.0.0 to 127.255.255.255, with a default mask of 255.0.0.0 (or /8 in CIDR).

This means that Class A addressing can have a total of 128 (27) networks and 16,777,214 (224-2) usable addresses per network.

Also, note that the range 127.0.0.0 to 127.255.255.255 within the Class A range is reserved for host loopback address (see RFC5735).

Class B IP Addresses

For Class B IP addresses, the first two octets (16 bits / 2 bytes) represent the network ID and the remaining two octets (16 bits / 2 bytes) are the host ID.

Class B IP addresses range from 128.0.0.0 to 191.255.255.255, with a default subnet mask of 255.255.0.0 (or /16 in CIDR).

Class B addressing can have 16,384 (214) network addresses and 65,534 (216) usable addresses per network.

Class C IP Addresses

For Class C IP addresses, the first three octets (24 bits / 3 bytes) represent the network ID and the last octet (8 bits / 1 bytes) is the host ID.

Class C IP Addresses range from 192.0.0.0 to 223.255.255.255, with a default subnet mask of 255.255.255.0 (or /24 in CIDR).

Class C translates to 2,097,152 (221) networks and 254 (28-2) usable addresses per network.

Class D and Class E IP Addresses

The last two classes are Class D and Class E.

Class D IP addresses are reserved for multicasts. They occupy the range from 224.0.0.0 through 239.255.255.255.

Class E IP addresses are experimental, and are anything over 240.0.0.0.

The Issue with Classful IP Addresses

The main issue with classful IP addresses is that it wasn't efficient, and could lead to a lot of wasted IP addresses.

For example, imagine that you're part of a large organization back then. Your company has 1,000 employees, meaning that it would fall into class B.

But if you look above, you'll see that a class B network can support up to 65,534 usable addresses. That's way more than your organization would likely need, even if each employee had multiple devices with a unique address.

And there was no way your organization could fall back to class C – there just wouldn't be enough usable IP addresses.

So while classful IP addresses were used around the time IPv4 addresses became widespread, it quickly became clear that a better system would be necessary to ensure we wouldn't use up all of the ~4.2 billion usable addresses.

Classful IP addresses haven't been used since they were replaced by CIDR in 1993, and are mostly studied to understand early internet architecture, and why subnetting is important.

I hope this cheat sheet has been a helpful reference for you

If you found this helpful, please share it with your friends so more people can benefit from it.

Also, feel free to reach out on Twitter and let me know what you think.

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References (2024)

FAQs

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References? ›

Subnet Cheat Sheet – 24 Subnet Mask, 30, 26, 27, 29, and other IP Address CIDR Network References
CIDRSubnet mask# of usable IP addresses
/31255.255.255.2542*
/30255.255.255.2522
/29255.255.255.2486
/28255.255.255.24014
29 more rows
Feb 12, 2021

How do you find the CIDR from an IP address and a subnet mask? ›

The CIDR number is typically preceded by a slash “/” and follows the IP address. For example, an IP address of 131.10. 55.70 with a subnet mask of 255.0. 0.0 (which has 8 network bits) would be represented as 131.10.

What is a 24 subnet? ›

The subnet mask shows what part is which. /24 means that the first 24 bits of the IP address are part of the Network number (192.168. 0) the last part is part of the host address (1-254).

What is a CIDR 24? ›

CIDR notation is really just shorthand for the subnet mask, and represents the number of bits available to the IP address. For instance, the /24 in 192.168. 0.101/24 is equivalent to the IP address 192.168. 0.101 and the subnet mask 255.255. 255.0 .

How is CIDR calculated? ›

How many addresses does a CIDR block represent? You calculate 2 32-prefix , where prefix is the number after the slash. For example, /29 contains 232-29=23=8 addresses. Here's a quick table that you can reference for the most CIDR blocks.

What is my CIDR address? ›

A CIDR IP address looks like a normal IP address except that it ends with a slash followed by a number, called the IP network prefix. CIDR addresses reduce the size of routing tables and make more IP addresses available within organizations.

How do I find my IP in CIDR notation? ›

In CIDR notation, IP addresses are written as a prefix, and a suffix is attached to indicate how many bits are in the entire address. The suffix is set apart from the prefix with a slash mark. For instance, in the CIDR notation 192.0. 1.0/24, the prefix is 192.0.

What is subnet CIDR? ›

CIDR is based on variable-length subnet masking (VLSM), which enables network engineers to divide an IP address space into a hierarchy of subnets of different sizes, making it possible to create subnetworks with different host counts without wasting large numbers of addresses.

What is a 29 subnet? ›

The /29 means that there are 29 bits set to one in the subnet mask. The remaining three bits are set to zero. So, for example, /24 is 255.255.255.0 (each of the 255s in decimal corresponds to 8 bits in binary: 11111111). It's just a shorthand.

How many IPS are in a 24? ›

So the scope of the question changes to now be “how many useable IP addresses can we generate off of the netmask?” and we can see that we can see that a network with a netmask of /24 has 254 unique IP addresses.

What is a 24 network? ›

2.0/24”, the number “24” refers to how many bits are contained in the network. From this, the number of bits left for address space can be calculated. As all IPv4 networks have 32 bits, and each “section” of the address denoted by the decimal points contains eight bits, “192.0.

What is a 30 subnet? ›

The /30 signifies that the network part of the address is 30 bits long, leaving 2 bits for the host part which equals 4 available addresses.

What is a 255.255 255.0 subnet? ›

A class C network would have a subnet mask of 255.255. 255.0 which means that 24 bits are used for the network. In CIDR notation this is designated by a /24 following the IP address.

How do you read a 24 IP range? ›

About Slash Notation
  1. Convert the subnet mask to binary. In this example, the binary representation of 255.255. 255.0 is: ...
  2. Count each 1 in the subnet mask. In this example, there are twenty-four (24).
  3. Write the original IP address, a forward slash (/), and then the number from Step 2. The result is 192.168. 42.23/24.

How many IP addresses are in a 29? ›

For example, you would request a “/29” subnet from your ISP, and you would be provided with a subnet of 8 IP Addresses, 6 of which are usable – this is because 1 is the network address (the first IP) and one is the broadcast address (the last IP).

What is a 32 CIDR? ›

the /32 is the CIDR (shorthand) and refers to how many 1's are in the subnet mask. For /32 that is 255.255.255.255 or 11111111.11111111.11111111.1111111. that means you can only have one ip address, on your network before needing a gateway/router to get outside that network. with /32 it's just you.

What is my IP address VPN? ›

Click on “Start”, then “Settings”, “Network & internet”, “Wi-Fi”. Select the network you're connected to. Click on “Properties.” Scroll down to the bottom of the window — your IP will be shown next to “IPv4 address.”

What is subnetwork address for a host with the IP address 200.10 5.68 28? ›

What is block size? What is the subnetwork address for a host with the IP address 200.10. 5.68/28? /28 means 11111111.11111111.

What does IP 28 mean? ›

Answer: 28 is a subnet mask. IP address has 32 bits in total. 28 denotes network ID while rest of the bits (which are 4 bits) are used for hosts.

What is default gateway in router? ›

A default gateway is the node in a computer network using the Internet protocol suite that serves as the forwarding host (router) to other networks when no other route specification matches the destination IP address of a packet.

What is a 31 subnet? ›

31-bit Subnet Mask (/31)

A 31-bit subnet mask is often used for an interface that is the endpoint of a point-to-point network. The use of 31-bit subnet masks for IPv4 point-to-point links is described in RFC 3021. For 192.168.0.0. Router A is connected via Fast-ethernet 0/0 having ip 192.168.

What is IPv6 Internet? ›

IPv6 (Internet Protocol version 6) is the sixth revision to the Internet Protocol and the successor to IPv4. It functions similarly to IPv4 in that it provides the unique IP addresses necessary for Internet-enabled devices to communicate.

What is IPv6 vs IPv4? ›

The main difference between IPv4 and IPv6 is the address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal address. IPv6 provides a large address space, and it contains a simple header as compared to IPv4.

What is a 30 network used for? ›

A /30 subnet is used for the two public IP addresses.

How big is a 26 subnet? ›

'x' in netmask '255.255. 255. x' is 256 - number of IP addresses in the subnet. In slash-notation, the netmask is '/y', where y = 32 - n, and 2ⁿ is the number of addresses in the subnet.
...
How to subnet an IPv4 /24.
SizeNetmask/
32255.255.255.224/27
64255.255.255.192/26
128255.255.255.128/25
256255.255.255.0/24
5 more rows

What is the subnet mask of prefix 28? ›

255.255.255.240

Is 255.0 255.0 a valid subnet mask? ›

The maximum values represent the network identifier and the minimum values represent the host identifier. For example, 255.255. 0.0 is a valid subnet mask as opposed to 255.0. 255.0.

What is CIDR value? ›

CIDR stands for Classlesss Inter-Domain Routing. It enables network administrators to group blocks of IP addresses into single routing networks. CIDR accomplishes the same task as traditional subnet masking. To understand what CIDR notation means, take the IP address 192.168.

What is the subnet mask of 192.168 1.0 24? ›

Subnet Mask (in Binary)

1.0 with subnet mask = 255.255. 255.0. Shorthand (AKA CIDR, Classless Inter-Domain Routing), this can be written 192.168. 1.0 /24 where the '/24' represents the number of subnetwork bits active in the mask.

What is the 24 at the end of an IP address? ›

2.0/24”, the number “24” refers to how many bits are contained in the network. From this, the number of bits left for address space can be calculated. As all IPv4 networks have 32 bits, and each “section” of the address denoted by the decimal points contains eight bits, “192.0.

How do you find the subnet mask? ›

IPv4 addresses are 32 bits made up of four octets of 8 bits each. To calculate the subnet mask, convert an IP address to binary, perform the calculation and then convert back to the IPv4 decimal number representation known as a dotted quad. The same subnetting procedure works for IPv6 addresses.

What is the subnetwork address first address for a host with IP address 200.10 5.68 28? ›

What is block size? What is the subnetwork address for a host with the IP address 200.10. 5.68/28? /28 means 11111111.11111111.

What is the subnet mask of 192.168 1.0 26? ›

255.255.255.192

What is the default gateway for 192.168 network? ›

Determining the Metric for the Default Gateway
DescriptionNetwork DestinationGateway
Default route0.0.0.0192.168.70.100
Loopback network127.0.0.1127.0.0.1
Local network192.168.69.0192.168.69.111
Local IP address192.168.69.111127.0.0.1
8 more rows

What is a 29 subnet? ›

The /29 means that there are 29 bits set to one in the subnet mask. The remaining three bits are set to zero. So, for example, /24 is 255.255.255.0 (each of the 255s in decimal corresponds to 8 bits in binary: 11111111). It's just a shorthand.

How many IP addresses are in a 29? ›

For example, you would request a “/29” subnet from your ISP, and you would be provided with a subnet of 8 IP Addresses, 6 of which are usable – this is because 1 is the network address (the first IP) and one is the broadcast address (the last IP).

What is IP CIDR? ›

CIDR (Classless Inter-Domain Routing) -- also known as supernetting -- is a method of assigning Internet Protocol (IP) addresses that improves the efficiency of address distribution and replaces the previous system based on Class A, Class B and Class C networks.

What is IPv6 vs IPv4? ›

The main difference between IPv4 and IPv6 is the address size of IP addresses. The IPv4 is a 32-bit address, whereas IPv6 is a 128-bit hexadecimal address. IPv6 provides a large address space, and it contains a simple header as compared to IPv4.

How do you break up a 24 subnet? ›

Learning Subnetting Part 3 - Dividing a Network into Subnets - YouTube

How do I find my subnet mask and network ID and host ID? ›

The network ID is found by logically ANDing the binary form of the IP address with the binary form of the subnet mask for the network. For example, if a host has an IP address of 172.16. 8.55 on a network with a subnet mask of 255.255. 0.0 (the default subnet mask), the network ID of the host is 172.16.

Top Articles
Latest Posts
Article information

Author: Pres. Lawanda Wiegand

Last Updated:

Views: 5627

Rating: 4 / 5 (71 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Pres. Lawanda Wiegand

Birthday: 1993-01-10

Address: Suite 391 6963 Ullrich Shore, Bellefort, WI 01350-7893

Phone: +6806610432415

Job: Dynamic Manufacturing Assistant

Hobby: amateur radio, Taekwondo, Wood carving, Parkour, Skateboarding, Running, Rafting

Introduction: My name is Pres. Lawanda Wiegand, I am a inquisitive, helpful, glamorous, cheerful, open, clever, innocent person who loves writing and wants to share my knowledge and understanding with you.