What a subnet mask is and why you need to know yours

A subnet mask is a number that tells your computer which other devices on your network it can talk to directly, and which ones it needs to send traffic through a router to reach. It looks like an IP address — something like 255.255.255.0 — but it works differently. Knowing your subnet mask matters because it affects which devices can see each other on your network, and misconfigured masks can create security gaps or break connections you need.

Your subnet mask is set automatically when you connect to most home networks, so you may never need to change it. But if you are troubleshooting a connection problem, setting up a new network segment, or trying to understand what devices can reach what, you need to see what mask your computer is actually using right now.

Key Takeaways

  • Your subnet mask is assigned automatically by your router in most home setups, and you can view it without changing anything.
  • On Windows, open Command Prompt and type ipconfig to see your subnet mask listed next to "Subnet Mask".
  • On Mac and Linux, open Terminal and type ifconfig or ip addr to find the mask in the output.
  • A subnet mask of 255.255.255.0 is standard for home networks and means your computer can reach any device with an IP address in the same third group of numbers.
  • If your subnet mask does not match your router's settings, your device may not be able to reach other machines on the network.

Checking your subnet mask on Windows

Open Command Prompt by pressing the Windows key, typing cmd, and pressing Enter. A black window will open. Type ipconfig and press Enter. Your computer will display a list of network connections.

Look for the connection you are using — usually labeled "Ethernet adapter" if you are plugged in with a cable, or "Wireless LAN adapter" if you are on WiFi. Under that section, you will see a line that says "Subnet Mask:" followed by a number like 255.255.255.0. That number is your subnet mask. Write it down or take a screenshot if you need to reference it later.

If you see multiple network adapters listed, make sure you are reading the mask from the one you actually use. If you are on WiFi, ignore the Ethernet adapter section.

Checking your subnet mask on Mac

Open System Preferences and click Network. Select the connection you are using — WiFi or Ethernet — from the list on the left. Click the Advanced button in the bottom right. Click the TCP/IP tab at the top.

You will see your IP address, and directly below it a field labeled "Subnet Mask:" with a number in it. That is your subnet mask. You can also see it in Terminal if you prefer the command line: open Terminal (search for it in Spotlight), type ifconfig, and press Enter. Find the section for your active connection and look for the line starting with "netmask" — the number there is your mask in hexadecimal format, but the System Preferences view is easier to read.

Checking your subnet mask on Linux

Open a terminal window. Type ip addr and press Enter. Your computer will display all network interfaces and their settings. Find the connection you are using — usually eth0 for Ethernet or wlan0 for WiFi — and look for a line that includes your IP address.

The subnet mask appears after a forward slash in CIDR notation. For example, if you see 192.168.1.50/24, the "/24" means your subnet mask is 255.255.255.0. If you want to see the mask in the traditional dotted format instead, type ifconfig and press Enter. Find your connection and look for "Mask:" followed by the number.

Understanding what your subnet mask means

A subnet mask of 255.255.255.0 is the standard for home networks. It means your computer can reach any other device on your network that has an IP address in the same range — for example, if your IP is 192.168.1.50, you can directly reach anything from 192.168.1.1 to 192.168.1.254 without going through the router first.

The mask works by comparing numbers. Each section of your IP address is compared to the matching section of the mask. Where the mask shows 255, the IP address section must match exactly. Where the mask shows 0, any number is allowed. So 255.255.255.0 means the first three sections of your IP must match other devices on your network, but the last section can be different.

If your subnet mask is different — for example, 255.255.0.0 — you can reach a much larger range of devices. This is rare in home networks but common in larger office networks. If you see something unusual, check that it matches what your router is set to.

What to do if your subnet mask does not match your router

If you checked your subnet mask and it does not match what your router is broadcasting, your device may have trouble reaching other machines on the network. The most common fix is to release and renew your IP address, which forces your computer to ask the router for new settings.

On Windows, open Command Prompt and type ipconfig /release, press Enter, then type ipconfig /renew and press Enter again. On Mac, go to System Preferences, Network, click your connection, and click Renew DHCP Lease. On Linux, type sudo dhclient -r to release, then sudo dhclient to renew.

After you renew, check your subnet mask again using the steps above. It should now match your router. If it still does not, restart your computer and check once more. If the problem persists, your router may have a configuration issue that needs attention.

When you might need to change your subnet mask manually

Most home networks work fine with automatic settings, and you should not need to change your subnet mask. But if you are setting up a separate network segment for guest devices, or if you are troubleshooting a specific connectivity problem, you may need to set it manually.

On Windows, open Command Prompt as Administrator, type netsh interface ipv4 set address name="Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1 (replacing the IP and mask with your values), and press Enter. On Mac, go to System Preferences, Network, select your connection, click Advanced, click TCP/IP, and change the "Configure IPv4" dropdown to Manual, then enter your mask. On Linux, edit your network configuration file — usually in /etc/netplan/ or /etc/network/interfaces — and add the mask to the appropriate interface.

If you are not sure whether you need to change it, do not. An incorrect manual setting can break your network connection entirely. Contact your router manufacturer or network administrator before making changes.

Frequently Asked Questions

Is my subnet mask the same as my IP address?

No. Your IP address identifies your specific device on the network, like a street address. Your subnet mask defines which other addresses are on the same local network, like a postal code. They work together but are separate numbers.

What does the /24 in my IP address mean?

The /24 is shorthand for a subnet mask of 255.255.255.0. The number represents how many bits of your IP address are used for the network part. /24 is the most common for home networks. You may also see /16 or /8 on larger networks.

Can a wrong subnet mask break my internet?

A wrong subnet mask can prevent you from reaching other devices on your local network, but it usually will not break your connection to the internet itself. However, if your mask is very different from what your router expects, some devices may not be able to find each other, making your network unusable.

Do I need to know my subnet mask to set up a find home network?

Not usually. Your router handles subnet mask settings automatically. You only need to know it if you are troubleshooting a connection problem or setting up advanced network features like separate guest networks or VLANs.

What if I see multiple subnet masks listed on my computer?

You may have multiple network adapters — for example, both Ethernet and WiFi. Each one can have its own subnet mask. Check which adapter you are actually using for your connection, and use the mask from that one. The others do not matter unless you are using them too.