What a subnet mask is and why you need it

A subnet mask is a number that tells your network which devices can talk to each other directly. It works alongside your IP address — if your IP address is like your home address, the subnet mask is like the boundary of your neighborhood. Devices on the same subnet can communicate without going through your router; devices on different subnets cannot.

You need to know your subnet mask when you're setting up a static IP address on a device, configuring network equipment, or troubleshooting why two devices can't reach each other even though they're both connected to your network. Most home networks use the same subnet mask for all devices, so once you find it once, you rarely need to find it again.

Your subnet mask is almost always already set on your device — you're not creating a new one, just reading what's already there. The process takes less than a minute on any device.

Key Takeaways

  • Your subnet mask is already configured on your device; you're reading an existing number, not setting a new one.
  • On Windows, open Command Prompt and type ipconfig to see your subnet mask listed as "Subnet Mask" next to your IP address.
  • On Mac or Linux, open Terminal and type ifconfig to find the subnet mask listed as "netmask".
  • Most home networks use 255.255.255.0 as the subnet mask, which is the default for standard home routers.
  • If you need a static IP address, use the same subnet mask your device is currently using unless your network administrator tells you otherwise.

Finding your subnet mask on Windows

Open Command Prompt by pressing the Windows key, typing cmd, and pressing Enter. Type ipconfig and press Enter. Your network information will appear on screen.

Look for the section labeled with your network name or "Ethernet" or "Wi-Fi" depending on how you're connected. You'll see your IP address listed, and directly below it will be "Subnet Mask" followed by a number like 255.255.255.0. That number is your subnet mask. Write it down if you need it for configuration.

If you have multiple network connections listed, find the one that shows an IP address starting with 192.168 or 10.0 (the ranges used on home networks). That's your local network connection, and its subnet mask is what you need.

Finding your subnet mask on Mac

Open Terminal by pressing Command + Space, typing terminal, and pressing Enter. Type ifconfig and press Enter. Your network information will display.

Look for the section labeled "en0" or "en1" (these are your network interfaces). Under that section, find the line that says "inet" followed by your IP address. On the next line, you'll see "netmask" followed by a hexadecimal number like 0xffffff00. This is your subnet mask in a different format.

To convert it to the standard format (like 255.255.255.0), count the number of "f" characters in the hex number and multiply by 4. If you see 0xffffff00, that's three groups of "ff" plus one group of "00" — which converts to 255.255.255.0. For most home networks, you'll see 0xffffff00, which is always 255.255.255.0.

Finding your subnet mask on Linux

Open a terminal window and type ifconfig, then press Enter. Your network interfaces and their settings will appear.

Find your active network connection (usually labeled eth0, wlan0, or ens33). Look for the line showing "inet addr" or "inet" with your IP address. The subnet mask appears on the same section as "Mask" or "netmask" followed by a number.

If the subnet mask appears in hexadecimal format (0xffffff00), use the same conversion method as Mac: count the "f" groups and multiply by 4. Most home networks show 255.255.255.0 in standard format or 0xffffff00 in hex format — both mean the same thing.

Finding your subnet mask through your router's settings

If you can't access your device's network settings, you can find the subnet mask through your router's admin panel. Open a web browser and type 192.168.1.1 or 192.168.0.1 into the address bar. Most home routers use one of these addresses.

Log in with your router's username and password (often "admin" and "admin" by default, though you may have changed this). Look for a section labeled "Network Settings," "LAN Settings," or "DHCP." The subnet mask will be listed there, usually as 255.255.255.0.

If neither address works, check the sticker on the back of your router — it usually shows the correct address and default login credentials. Once you're logged in, the subnet mask is the same for all devices on your network, so you only need to find it once.

What to do if your subnet mask looks unusual

Most home networks use 255.255.255.0 as the subnet mask. If you see something different — like 255.255.0.0 or 255.255.255.128 — your network is configured differently than the standard setup, but it will still work the same way.

If you're setting up a static IP address and your device currently shows a different subnet mask, use that same mask for your static configuration. Don't change it to 255.255.255.0 unless your network administrator tells you to. Mismatched subnet masks are one of the most common reasons devices can't communicate on the same network.

If you're unsure whether your subnet mask is correct, check what other devices on your network are using. Open Command Prompt or Terminal on another computer and run ipconfig or ifconfig. If all devices show the same subnet mask, yours is correct.

Using your subnet mask for static IP setup

Once you've found your subnet mask, you have the information you need to assign a static IP address to a device. Static IPs are useful for devices you want to always reach at the same address — like a printer, security camera, or NAS drive.

When you configure the static IP, you'll need three pieces of information: the IP address you want to assign, the subnet mask (which you just found), and your router's IP address (usually 192.168.1.1 or 192.168.0.1). Enter the same subnet mask your device is currently using. This ensures the device stays on the same network as everything else.

The process for setting a static IP varies by device type, but the subnet mask number stays the same across all of them. Write it down so you have it ready when you configure each device.

Frequently Asked Questions

Can I have different subnet masks on different devices on the same network?

You can, but you shouldn't. Devices with different subnet masks won't be able to talk to each other directly, even if they're connected to the same router. Keep the subnet mask the same across all devices on your home network. If a device is showing a different mask, change it to match the others.

What does the subnet mask actually do with the IP address?

The subnet mask uses math to determine which part of an IP address identifies the network and which part identifies the individual device. With 255.255.255.0, the first three numbers of your IP address identify your network, and the last number identifies your device. This is why devices with similar IP addresses (like 192.168.1.5 and 192.168.1.10) can talk directly, but 192.168.1.5 and 192.168.2.5 cannot.

Is 255.255.255.0 always the right subnet mask for home networks?

Yes, for the vast majority of home networks. Some advanced setups use different masks, but if you're setting up a home network, 255.255.255.0 is the standard. If your router is already using something different, stick with what it's using rather than changing it.

Do I need to restart my device after finding my subnet mask?

No. Finding your subnet mask doesn't change anything — you're just reading a number that's already configured. You only need to restart if you actually change the subnet mask, which you shouldn't do on a home network unless you have a specific reason.

What if ipconfig or ifconfig doesn't show a subnet mask?

This usually means the device isn't connected to the network yet, or the connection failed. Check that your device is connected to Wi-Fi or has an ethernet cable plugged in. If it's connected and still not showing, try unplugging the router for 30 seconds, plugging it back in, and running the command again.