What a subnet mask is and why you need to know yours
A subnet mask is a string of numbers that tells your device which part of an IP address belongs to your local network and which part identifies individual devices on that network. It looks like an IP address — four numbers separated by dots, like 255.255.255.0 — but it works differently. Your device uses it to figure out whether another device is on the same network as you or somewhere else entirely.
You might need to find your subnet mask to troubleshoot a connection problem, set up a printer or server on your home network, or understand why two devices can't talk to each other even though they're both connected to the same router. Most of the time your device gets the subnet mask automatically from your router, so you don't think about it. But when something stops working, knowing how to find it is the first step to fixing it.
Key Takeaways
- Your subnet mask appears in your network settings alongside your IP address, and the method to find it depends on whether you use Windows, Mac, or Linux.
- On Windows, open Command Prompt and type ipconfig to see your subnet mask listed as "Subnet Mask" next to your IP address.
- On Mac, go to System Settings, click Network, select your connection, and look for the subnet mask in the TCP/IP tab.
- On Linux, open a terminal and type ip addr or ifconfig to display your subnet mask in CIDR notation or traditional format.
- A subnet mask of 255.255.255.0 is the most common for home networks, but yours may differ depending on your router's configuration.
Finding your subnet mask on Windows
The fastest way on Windows is through Command Prompt. Press the Windows key, type cmd, and open Command Prompt. Type ipconfig and press Enter. You'll see a list of all your network connections. Look for the one you're currently using — usually labeled "Ethernet" if you're plugged in with a cable, or "Wireless LAN adapter" if you're on Wi-Fi.
Next to "IPv4 Address" you'll see your IP address. Directly below it, you'll see "Subnet Mask" followed by four numbers separated by dots. Write that down or take a screenshot. If you have multiple network adapters listed, make sure you're looking at the right one — the one with an actual IP address assigned to it.
If you prefer not to use Command Prompt, you can also find it through Settings. Open Settings, go to Network & Internet, then Status. Click "View your network properties" and scroll down until you see "Subnet mask" listed under your active connection.
Finding your subnet mask on Mac
On Mac, open System Settings and click Network in the sidebar. Select the connection you want to check — Wi-Fi or Ethernet — and click the Details button. A new window opens showing your network information. Click the TCP/IP tab at the top.
You'll see your IP address listed as "IPv4 Address". Below that is "Subnet Mask" with the four numbers you're looking for. If you don't see a Details button, your connection may already be showing the information on the main screen. Look for "Subnet Mask" in the list of details displayed.
On older versions of macOS, the path is slightly different: go to System Preferences instead of System Settings, then Network, then select your connection and click Advanced. The TCP/IP tab is still where you'll find the subnet mask.
Finding your subnet mask on Linux
Open a terminal and type ip addr, then press Enter. This shows all your network interfaces and their addresses. Look for your active connection — usually eth0 for Ethernet or wlan0 for Wi-Fi. Next to "inet" you'll see your IP address followed by a slash and a number, like 192.168.1.100/24. That number after the slash is the subnet mask in CIDR notation.
If you want to see the subnet mask in the traditional four-number format (like 255.255.255.0), type ifconfig instead. This older command shows "Netmask" directly next to your IP address in the format you're probably expecting. Not all Linux distributions include ifconfig by default, so ip addr is more reliable across different systems.
Understanding what the numbers mean
A subnet mask of 255.255.255.0 is the most common for home networks and small offices. The 255 values mean "this part of the address identifies the network," and the 0 means "this part identifies individual devices." So with 255.255.255.0, the first three numbers of your IP address describe your network, and the last number identifies your device.
If your subnet mask is different — say, 255.255.0.0 or 255.255.255.128 — your network is divided differently. A smaller subnet mask (more zeros) means more devices can be on your network. A larger one (more 255s) means fewer devices but tighter organization. Unless you set up your network manually, your router chose this for you, and you probably don't need to change it.
In CIDR notation, the number after the slash tells you the same thing. /24 means the first 24 bits identify the network, which equals 255.255.255.0 in traditional format. /16 equals 255.255.0.0. /32 means a single device. If you see a different number, an online CIDR converter can show you the traditional format.
What to do once you have your subnet mask
Once you know your subnet mask, you can figure out which devices should be able to reach each other directly. Two devices are on the same local network if their IP addresses match in all the positions where the subnet mask shows 255. For example, with a 255.255.255.0 mask, 192.168.1.5 and 192.168.1.200 are on the same network, but 192.168.1.5 and 192.168.2.5 are not.
If two devices should be on the same network but can't communicate, a mismatched subnet mask is often the culprit. Check that both devices have the same subnet mask. If one device has 255.255.255.0 and another has 255.255.0.0, they won't recognize each other as local neighbors even if they're physically connected to the same router.
For most home users, knowing your subnet mask is useful for troubleshooting but not something you'll change. If you're setting up a server, printer, or other device that needs a static IP address, you'll want to use the same subnet mask your router assigned to you automatically.
Common reasons your subnet mask might look different
If your subnet mask doesn't match what you expected, there are a few common reasons. Some routers use non-standard masks for specific purposes — a /25 mask (255.255.255.128) splits a network in half, which some people do to isolate guest networks or separate device types. A /30 mask (255.255.255.252) is common on point-to-point connections like VPN links.
If you're on a corporate or school network, the subnet mask might be much smaller than a home network's. A /16 or /8 mask allows thousands of devices on a single network. This doesn't mean anything is wrong — it just means the network is organized differently than a typical home setup.
If you changed your router's settings yourself and now devices can't find each other, a mismatched subnet mask is worth checking. If you didn't change anything and your subnet mask suddenly looks different, your router may have reset to factory defaults, which sometimes happens after a power outage or failed update.
Frequently Asked Questions
Is my subnet mask the same as my network mask?
Yes, they're the same thing. "Network mask" and "subnet mask" are used interchangeably. Both refer to the same four-number string that defines which part of your IP address is the network and which part is the device.
What if I see a subnet mask I don't recognize?
Write it down and check it against a CIDR conversion chart online. As long as your devices can communicate with each other and reach the internet, an unfamiliar subnet mask isn't a problem. It just means your network is organized differently than the most common home setup.
Can I change my subnet mask myself?
Yes, but you usually shouldn't unless you're setting up a static IP address or reconfiguring your network intentionally. If you change it on one device but not others, they won't recognize each other. If you need to change it, change it on all devices at once or let your router assign it automatically.
Why do I need to know my subnet mask if my router handles it automatically?
Most of the time you don't. But when a device can't connect to another device on your network, or when you're setting up something manually, knowing your subnet mask helps you diagnose the problem quickly instead of guessing.
Is the subnet mask the same on all my devices?
It should be if they're all on the same network. If one device has a different subnet mask, it won't recognize the others as local neighbors. Check that all devices connected to the same router have the same subnet mask.