What a subnet mask is and why you need it
A subnet mask is a number that tells your devices which part of an IP address belongs to your local network and which part identifies individual devices on that network. It looks similar to an IP address — for example, 255.255.255.0 — but it serves a completely different purpose. When you set up a home network, your router assigns both an IP address and a subnet mask to each device. Knowing how to find the subnet mask is useful when you're troubleshooting connection problems, configuring devices manually, or understanding how your network is divided.
The subnet mask works alongside the IP address like a postal code works with a street address. The IP address identifies a specific device, but the subnet mask defines the boundaries of the network that device belongs to. Without the correct subnet mask, devices on your network may not be able to communicate with each other, even if they have valid IP addresses.
Key Takeaways
- On Windows, open Command Prompt and type ipconfig to see your IP address and subnet mask listed together under your active network connection.
- On Mac or Linux, open Terminal and type ifconfig or ip addr to find the subnet mask displayed as a netmask or prefix.
- On your router's admin page, the subnet mask is usually listed under LAN settings or network configuration, accessible by typing your router's IP address into a web browser.
- Most home networks use the subnet mask 255.255.255.0, which allows up to 254 usable devices on the same network.
- If you see a different subnet mask like 255.255.0.0, your network is configured differently and supports more devices, but this is uncommon in home setups.
Finding the 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 button, select "Command Prompt (Admin)" or "Windows PowerShell (Admin)", and type ipconfig then press Enter. You will see a list of all your network connections. Look for the one labeled "Ethernet" if you are plugged in with a cable, or "Wireless LAN adapter" if you are using Wi-Fi.
Under that connection, you will see four pieces of information: IPv4 Address, Subnet Mask, Default Gateway, and DHCP Server. The Subnet Mask line is what you need. Write it down exactly as it appears. If you see something like 255.255.255.0, that is the standard mask for most home networks. If the numbers are different, your network is configured with a different size, which is less common but still valid.
If you prefer not to use Command Prompt, you can also find this information through the Settings app. Go to Settings > Network & Internet > Wi-Fi (or Ethernet), click your active connection, and scroll down to find "IPv4 settings" or "IP settings". The subnet mask will be listed there, though it may be labeled as "Subnet prefix length" shown as a number like /24 instead of 255.255.255.0. Both formats mean the same thing.
Finding the subnet mask on Mac
On a Mac, open the Terminal process (found in Applications > Utilities) and type ifconfig then press Enter. You will see information for each network connection on your computer. Find the section for your active connection — usually labeled "en0" for Ethernet or "en1" for Wi-Fi — and look for the line that says netmask. The subnet mask will appear as a hexadecimal number like 0xffffff00, which converts to 255.255.255.0 in standard notation.
If the hexadecimal format is confusing, there is an easier way. Click the Apple menu, go to System Settings > Network, select your active connection (Wi-Fi or Ethernet), and click "Details". Under the TCP/IP tab, you will see the subnet mask listed in standard format like 255.255.255.0. This method shows the information in the same format you would see on Windows, making it easier to compare across devices.
Finding the subnet mask on Linux
On a Linux system, open a terminal and type ip addr or ifconfig depending on which version of Linux you are running. The newer command ip addr works on most modern distributions. You will see a list of network interfaces. Find your active connection and look for the line that shows your IP address. The subnet mask will appear after a forward slash, written as a prefix like /24. This number represents the same information as 255.255.255.0 — the /24 means the first 24 bits of the address identify the network.
If you need the subnet mask in the traditional 255.255.255.0 format rather than the /24 prefix format, you can use an online converter or calculate it yourself. However, for most troubleshooting purposes, the /24 format is sufficient and tells you everything you need to know about your network size.
Finding the subnet mask on your router
Your router also stores the subnet mask for your entire network. To access it, 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 of those works. You will be prompted to log in with a username and password — the default is often admin/admin, but this varies by manufacturer.
Once logged in, look for a section called "LAN Settings", "Network Settings", or "Basic Settings". The subnet mask for your entire network will be listed there. This is the mask that applies to all devices connected to your router, whether they are wired or wireless. If you change the subnet mask here, it affects every device on your network, so only make changes if you understand the consequences or are following specific troubleshooting steps.
Understanding what different subnet masks mean
The most common subnet mask for home networks is 255.255.255.0, which allows your network to support up to 254 usable devices. The first three numbers (255.255.255) define the network itself, and the last number (0) is where individual device addresses are assigned. If you see 255.255.0.0, your network is much larger and can support thousands of devices — this is typical in offices or larger organizations, not homes. If you see 255.255.255.128 or 255.255.255.192, your network is smaller and supports fewer devices, which is sometimes used when dividing a network into smaller segments.
The subnet mask also appears in prefix notation, where /24 means the same thing as 255.255.255.0, /16 means 255.255.0.0, and /25 means 255.255.255.128. Both formats are correct — they are just different ways of writing the same information. If you are looking at documentation or settings that use one format and you are more familiar with the other, you can convert between them using an online subnet calculator, though for basic home network troubleshooting, you do not need to convert anything.
What to do if your subnet mask looks wrong
If you find that different devices on your network have different subnet masks, that is usually a problem. All devices on the same network should have the same subnet mask. If one device shows 255.255.255.0 and another shows 255.255.0.0, they may not be able to communicate with each other even though they are connected to the same router. This often happens when a device is configured manually instead of receiving its settings automatically from the router.
To fix this, go back to that device's network settings and switch it to obtain the IP address and subnet mask automatically. On Windows, this means going to Settings > Network & Internet > Ethernet (or Wi-Fi), clicking "Edit", and selecting "Automatic (DHCP)" instead of "Manual". On Mac, go to System Settings > Network > Wi-Fi (or Ethernet) > Details > TCP/IP and select "Using DHCP" from the Configure dropdown. This tells the device to ask the router for the correct settings instead of using a manually entered value.
Frequently Asked Questions
Why do I need to know my subnet mask?
You need it when troubleshooting why devices cannot see each other, when setting up a device manually instead of letting the router assign settings automatically, or when configuring advanced network features. Most of the time your router handles this automatically and you never need to think about it.
Is 255.255.255.0 always the right subnet mask for home networks?
Yes, 255.255.255.0 is the standard for home networks and works for almost all home setups. If your router is using something different, it was either configured that way intentionally or there is a problem. Check your router's settings to confirm.
What does the /24 in my subnet mask mean?
The /24 is shorthand for 255.255.255.0. The number represents how many bits of the IP address are used for the network portion. Both formats mean exactly the same thing, just written differently.
Can I change my subnet mask to support more devices?
Yes, but only if you understand what you are doing. Changing the subnet mask on your router affects all connected devices. For most home networks, 255.255.255.0 is sufficient. If you genuinely need more device addresses, consult your router's manual or contact your internet provider before making changes.
What if I cannot access my router's admin page?
Try the default IP address 192.168.0.1 or 192.168.1.1 in your browser. If neither works, check the label on the back of your router for the correct address. If you have changed the password and forgotten it, you may need to reset the router to factory settings using the reset button on the back.