Where to find your subnet mask depends on your operating system

Your subnet mask is a string of numbers that tells your computer which devices are on the same local network as you. It looks like an IP address — something like 255.255.255.0 — but it serves a different purpose. You'll need it if you're troubleshooting network problems, setting up a printer on your network, or configuring a router.

The fastest way to find it is through your network settings, and the exact steps differ depending on whether you use Windows, Mac, or Linux. On any system, you can also find it by opening a command-line tool and running a single command.

Key Takeaways

  • Windows users can find the subnet mask in Settings > Network & Internet > Advanced Network Settings, or by running ipconfig in Command Prompt.
  • Mac users can open System Settings > Network, select their connection, and click Details to see the subnet mask listed as "Subnet Mask".
  • Linux users can run ip addr or ifconfig in the terminal to display the subnet mask alongside the IP address.
  • The command-line method works the same way on all three systems and shows you the subnet mask in seconds without navigating menus.

Finding your subnet mask on Windows

Open Settings and go to Network & Internet. Click on Advanced Network Settings, then scroll down and select View Your Network Properties. You'll see a list of your network connections. Find the one you're currently using — it will show "Connected" next to it — and click on it. The subnet mask appears in the details as "IPv4 Subnet Mask".

If you prefer the command-line method, open Command Prompt by pressing Windows Key + R, typing cmd, and pressing Enter. Type ipconfig and press Enter. Look for the line that says "Subnet Mask" under the network adapter you're using. This method is often faster if you just need the number and don't want to click through menus.

Finding your subnet mask on Mac

Open System Settings and click Network in the sidebar. Select the network connection you're using — usually Wi-Fi or Ethernet — then click Details. A window opens showing your network information. The subnet mask is listed as "Subnet Mask" and appears as a series of four numbers separated by periods.

From the command line, open Terminal (find it in Applications > Utilities) and type ifconfig, then press Enter. Scroll through the output to find your active connection. The subnet mask appears on the line that starts with "netmask" and is shown in hexadecimal format (starting with 0x). If you want it in the standard decimal format, use ip addr instead, which displays it more clearly.

Finding your subnet mask on Linux

Open a terminal window and type ip addr, then press Enter. Look for your active network connection — usually labeled eth0, wlan0, or similar — and find the line that shows your IP address. The subnet mask appears on the same line after a forward slash, shown as a number between 0 and 32 (called CIDR notation). For example, /24 is equivalent to the subnet mask 255.255.255.0.

If you prefer the traditional format, type ifconfig instead. This displays the subnet mask as "Netmask" in the standard decimal format. Both commands show the same information; ip addr is the newer standard, while ifconfig is older but still widely available.

Understanding what the subnet mask tells you

The subnet mask works by dividing your IP address into two parts: the network portion and the host portion. A subnet mask of 255.255.255.0 means the first three sets of numbers in your IP address identify your network, and the last set identifies individual devices on that network. If your IP is 192.168.1.50 with that subnet mask, then any device with an IP between 192.168.1.1 and 192.168.1.254 is on your local network.

This matters because your computer uses the subnet mask to decide whether it can reach another device directly or needs to send traffic through a router. If two devices have the same network portion but different host portions, they're on the same subnet and can communicate without a router. If the network portions differ, they're on different subnets.

When you need to know your subnet mask

Most of the time, your operating system handles the subnet mask automatically and you never need to think about it. But there are situations where you'll need to find it. If you're setting up a static IP address on a printer or network device, you'll need to enter the subnet mask manually. If you're troubleshooting why a device on your network isn't reachable, knowing the subnet mask helps you verify that both devices are on the same network.

Some network configuration tools also ask for the subnet mask when you're setting up a VPN, configuring a router, or diagnosing connectivity problems. In those cases, having the number ready saves time and prevents mistakes from typing it incorrectly.

Frequently Asked Questions

Is the subnet mask the same on all my devices?

Not necessarily. Each device on your network gets its own IP address, but they should all have the same subnet mask if they're on the same local network. If one device has a different subnet mask, it won't be able to reach the others directly. Check the subnet mask on a few devices to make sure they match.

What does a /24 or /16 mean when I see it in Linux?

That's CIDR notation, a shorthand for the subnet mask. /24 means the first 24 bits of the address identify the network, which equals 255.255.255.0 in standard format. /16 equals 255.255.0.0, and /32 equals 255.255.255.255. Linux often displays it this way because it's more compact.

Can I change my subnet mask?

Yes, but you shouldn't unless you know what you're doing. Changing it incorrectly can disconnect your device from the network. If you need to change it, do it through your router's settings, not on individual devices. Most home networks use 255.255.255.0 and don't need to be changed.

Why do I see multiple subnet masks when I run ipconfig or ifconfig?

You're probably seeing multiple network adapters. Your computer might have Wi-Fi, Ethernet, and virtual network adapters all listed. Find the one you're actually using — it will show as "Connected" or "Active" — and use that subnet mask.