What a subnet mask is and why you need it
A subnet mask is a number that tells your device which part of an IP address belongs to the network and which part identifies your specific device on that network. It looks similar to an IP address — for example, 255.255.255.0 — but it serves a completely different purpose. Without knowing the subnet mask, your device cannot communicate properly with other devices on the same network.
The subnet mask is paired with every IP address on your network. When you look up an IP address, you almost always need to look up its subnet mask at the same time. The two work together: the IP address says "this is device X" and the subnet mask says "device X belongs to this group of devices."
Key Takeaways
- Your device's subnet mask is stored in your network settings and can be found through your operating system's built-in network tools.
- Windows users can find the subnet mask by opening Command Prompt and typing ipconfig, then looking for the line labeled "Subnet Mask."
- Mac and Linux users can open Terminal and type ifconfig or ip addr to see the subnet mask listed with their network information.
- If you know only an IP address without its subnet mask, you cannot determine the subnet mask — it must come from the network administrator or device settings.
- Most home networks use 255.255.255.0, but business networks and larger installations use different masks depending on how many devices they need to support.
Finding your subnet mask on Windows
The fastest way to find your subnet mask on a Windows computer is through the Command Prompt. Right-click the Start menu, select "Command Prompt (Admin)" or "Windows PowerShell (Admin)," and type ipconfig then press Enter. Your network information will appear on screen.
Look for the section labeled with your network name or "Ethernet adapter" or "Wireless LAN adapter." Under that section, find the line that says "Subnet Mask:" — the number next to it is what you are looking for. Write it down exactly as it appears. If you have multiple network connections, you may see multiple subnet masks; make sure you are reading the one for the network you actually use.
If you prefer not to use Command Prompt, you can also find this information through the Settings app. Open Settings, go to Network & Internet, select your connection type (Ethernet or Wi-Fi), and click "View your network properties." Scroll down until you see "IPv4 subnet mask" — that is your subnet mask.
Finding your subnet mask on Mac
On a Mac, open the Terminal application (you can find it in Applications > Utilities or search for it using Spotlight). Type ifconfig and press Enter. Your network information will display in the Terminal window.
Look for the section that corresponds to your active network connection — usually labeled "en0" for Ethernet or "en1" for Wi-Fi. Within that section, find the line that starts with "netmask" — the hexadecimal number that follows is your subnet mask in a different format. To convert it to the standard format (like 255.255.255.0), you can use an online subnet mask converter, or you can look for the line labeled "inet" which sometimes shows the subnet mask in standard notation.
Alternatively, you can find this through System Preferences. Click the Apple menu, select System Preferences (or System Settings on newer Macs), go to Network, select your active connection, and click "Advanced." The subnet mask appears on the TCP/IP tab.
Finding your subnet mask on Linux
Open a Terminal window and type ip addr then press Enter. Your network interfaces and their information will display. Look for your active network connection (often labeled "eth0" for Ethernet or "wlan0" for Wi-Fi) and find the line that shows your IP address.
The subnet mask on Linux systems is often shown in CIDR notation — a forward slash followed by a number, like /24. This number represents the subnet mask in a compressed format. The number 24 means the first 24 bits of the address are the network portion, which converts to the standard subnet mask 255.255.255.0. If you need the traditional format, you can use an online converter or type ifconfig instead of ip addr, which displays the subnet mask in the standard format on some Linux distributions.
Understanding what the subnet mask number means
Subnet masks follow a pattern. The most common one on home networks is 255.255.255.0, which means the first three sections of your IP address identify the network, and the last section identifies your device. If your IP address is 192.168.1.50 and your subnet mask is 255.255.255.0, then 192.168.1 is your network address and 50 is your device number on that network.
Other common subnet masks include 255.255.0.0 (used on larger networks) and 255.255.255.128 (used when a network needs to be split into smaller groups). Each different mask allows a different number of devices on the network. A network administrator chooses the subnet mask based on how many devices need to connect. You do not need to calculate or change this yourself — it is set up when the network is installed.
When you have an IP address but no subnet mask
If someone gives you an IP address and asks you to find its subnet mask, you cannot determine it from the IP address alone. The subnet mask is not hidden in the IP address — it is a separate piece of information that must come from somewhere else. You need to ask the network administrator, check the device's network settings, or look at the network documentation.
The only exception is if the IP address is written in CIDR notation, like 192.168.1.50/24. The number after the slash (24 in this example) tells you the subnet mask is 255.255.255.0. If you see an IP address written this way, the subnet mask information is already included.
Checking your router's subnet mask settings
Your router also has a subnet mask setting, and it should match the subnet mask on your devices. To check your router's settings, open a web browser and type your router's IP address into the address bar — this is usually 192.168.1.1 or 192.168.0.1, but check your router's label or manual if neither works. Log in with your router's username and password (also on the label if you have not changed it).
Once logged in, look for a section called "Network Settings," "LAN Settings," or "DHCP Settings." The subnet mask should be listed there. If your router's subnet mask does not match the subnet mask on your devices, your devices may have trouble communicating with each other. If you find a mismatch, contact your network administrator before making changes.
Frequently Asked Questions
Can I change my subnet mask myself?
You can change it in your device's network settings, but you should not do this without guidance from your network administrator. Changing the subnet mask incorrectly will break your network connection. If you think your subnet mask is wrong, ask your network administrator to verify it first.
Why do some subnet masks look like 255.255.255.0 and others look like /24?
Both formats represent the same thing — they are just different ways of writing it. The /24 format is called CIDR notation and is more compact. The 255.255.255.0 format is the traditional notation. Online converters can switch between them if you need to.
Is the subnet mask the same on every device on my network?
Yes, all devices on the same network should have the same subnet mask. If one device has a different subnet mask, it will not be able to communicate with the others. This is usually a sign of a configuration error.
What if ipconfig or ifconfig does not show a subnet mask?
This usually means your device is not connected to a network, or the network connection is not working properly. Check that your Ethernet cable is plugged in or that you are connected to Wi-Fi. If you are connected and still do not see a subnet mask, your network adapter may need to be restarted or reinstalled.
Do I need to know my subnet mask to use the internet?
Your device needs a subnet mask to work on a local network, but you do not need to know what it is for basic internet use. Your device is configured with one automatically. You only need to look it up if you are troubleshooting a network problem or setting up a new network connection.