IP addresses and subnet masks are essential for anyone learning about networking. When you connect to a network, your device is assigned an IP address and a subnet mask. But what exactly are these, and how do you find a subnet mask from an IP address?
In this blog, we will explain what an IP address is, what a subnet mask does, and how to find the subnet mask from IP address in simple steps.
What Is an IP Address?
An IP address is like a home address for your device on a network. Just as every house has a unique address to receive mail, every device on a network has an IP address.
An IP address helps to identify and locate devices on the internet. IP addresses are made up of four sets of numbers separated by periods, such as 192.168.1.1.
Types of IP addresses:
1. IPv4 (Internet Protocol version 4):
An IPv4 address is a 32-bit number, usually written as four numbers separated by dots (e.g., 192.168.1.1). Each number ranges from 0 to 255.
2. IPv6 (Internet Protocol version 6):
An IPv6 address is a 128-bit number, written in hexadecimal and separated by colons. IPv6 was created to solve the shortage of IPv4 addresses.
What Is a Subnet Mask?
A subnet mask is another number that works with an IP address. While an IP address identifies the device, a subnet mask divides the network into smaller parts called subnets.
A subnet mask helps route the data packets to the correct destination within the network. It tells which part of the IP address represents the network and which part represents the device.
Why Do You Need to Know the Subnet Mask?
Knowing the subnet mask is crucial because it affects the working of your devices.
- Efficient IP address management: It can optimize the allocation of IP addresses, ensuring that each subnet has an appropriate number of IPs by subdividing a larger network into smaller subnets.
- Improved security: Subnetting can minimize the potential spread of malicious activity and improve network security by cutting off network segments.
- Reduced network congestion: Smaller subnets reduce the size of the broadcast domain, leading to less network traffic and improved performance.
How to Find the Subnet Mask from An IP Address
To find a subnet mask, you need to know the IP address and the type of network it belongs to. Networks are categorized into classes: A, B, C, D, and E. Most home networks use Class C. Here are the steps to find the subnet mask:
Step 1: Identifying the Class of the IP Address
IP addresses are divided into five classes: A, B, C, D, and E. The class determines the default subnet mask. The first number in the IP address helps to identify the class:
- Class A: IP addresses from 1.0.0.0 to 126.0.0.0
- Class B: IP addresses from 128.0.0.0 to 191.255.0.0
- Class C: IP addresses from 192.0.0.0 to 223.255.255.0
- Class D and E: Designed for special purposes and not commonly used in home or business networks.
For example, if the IP address is 192.168.1.1, it falls within the range of Class C.
Step 2: Determining the Default Subnet Mask
Each class of IP addresses has a default subnet mask.
The default subnet masks of different classes:
Class | Range | Default Subnet Mask | Description |
A | 1.0.0.0 – 126.0.0.0 | 255.0.0.0 | Large networks, millions of hosts |
B | 128.0.0.0 – 191.255.0.0 | 255.255.0.0 | Medium-sized networks, thousands of hosts |
C | 192.0.0.0 – 223.255.255.0 | 255.255.255.0 | Small networks, hundreds of hosts |
D | 224.0.0.0 – 239.255.255.255 | Not applicable | Reserved for multicast groups |
E | 240.0.0.0 – 255.255.255.255 | Not applicable | Reserved for experimental use |
Why the default subnet masks of Class D and Class E are not applicable?
Class D (Multicast) and Class E (Experimental) IP address ranges are not used for assigning individual devices or hosts in a typical network, so they do not require subnet masks.
Step 3: Finding the Subnet Mask by Calculating (If Needed)
Sometimes, you may need to calculate the subnet mask if the network uses a custom subnet. This is done using a process called subnetting. Subnetting divides a large network into smaller subnets to improve security and reduce congestion.
To calculate a custom subnet mask, you need to know how many bits are used for the network part and how many for the host part of the IP address.
A simple way to calculate is using an online subnet calculator. There are some simple online subnet calculators like SolarWinds Advanced Subnet Calculator and Tunnels Up Subnet Calculator.
Step 4: Finding the Subnet Mask Manually
If you need to find a subnet mask manually, you can convert the IP address and the default subnet mask into binary numbers. Each set of numbers in the IP address and subnet mask is converted into 8-bit binary numbers. For example:
- IP Address (192.168.1.1): 11000000.10101000.00000001.00000001
- Default Subnet Mask (255.255.255.0): 11111111.11111111.11111111.00000000
By looking at the binary form, you can understand which part of the IP is for the network and the host.
Step 5: Finding the Subnet Mask Using CIDR Notation
CIDR (Classless Inter-Domain Routing) notation is another way to express a subnet mask. It is written as a slash (/) followed by a number, like /24. This number represents how many bits are set to 1 in the subnet mask. For example, /24 means 255.255.255.0.
Common CIDR notations and their uses:
CIDR Notation | Subnet Mask | Hosts per Subnet | Example Network Address |
/8 | 255.0.0.0 | 16,777,214 | 10.0.0.0 |
/16 | 255.255.0.0 | 65,534 | 172.16.0.0 |
/24 | 255.255.255.0 | 254 | 192.168.1.0 |
/30 | 255.255.255.252 | 2 | 192.168.1.0 |
Common Situations Where You Need to Find Subnet Masks
1. Setting Up a Home Network
When setting up routers or switches, you need to know the subnet mask to ensure all devices can communicate correctly.
2. Checking Network Issues
If devices on the same network cannot communicate, checking the IP address and subnet mask settings is a good starting point.
3. Configuring Firewalls and VPNs
Subnet masks allow network administrators to divide larger networks into smaller, manageable subnets. This division can improve data routing, minimize congestion, and add an extra layer of security by isolating sensitive areas of the network.
When used with a VPN service such as LightningX VPN, subnet masks can ensure that LightningX VPN’s encrypted traffic is correctly routed through the desired virtual network while maintaining the integrity of your private data.
LightningX VPN does provide advanced encryption technology such as encryption algorithms like AES-256-GCM. This can ensure that your transffered data will not be intercepted. With subnet’s data routing, the security layer will be stronger.

Conclusion
It seems complicated to find a subnet mask from an IP address, but it’s quite easy once you understand the basics. This blog guides you on what an IP address and subnet mask are, and also how to find the subnet mask from an IP address. When you want to subscribe to VPN services like LightningX VPN, hope this guide is helpful!