Understanding how to find the subnet mask of an IP address is a fundamental skill for anyone managing a network, troubleshooting connectivity issues, or studying for IT certifications. The subnet mask acts as a filter, telling devices which portion of an IP address identifies the network and which part identifies the specific host. Without this critical piece of information, devices cannot determine if a destination is on the local network or if traffic needs to be routed through a gateway. Whether you are a system administrator configuring a new server, a student learning CIDR notation, or a home user trying to fix a printer connection, knowing where to locate this value across different operating systems and scenarios is essential.
And yeah — that's actually more nuanced than it sounds.
Why the Subnet Mask Matters
Before diving into the methods of discovery, it helps to understand what you are looking for. An IP address consists of two parts: the Network ID and the Host ID. The subnet mask is a 32-bit number (for IPv4) that masks the IP address to separate these two components. Here's one way to look at it: a common subnet mask like 255.Because of that, 255. 255.0 (or /24 in CIDR notation) indicates that the first three octets represent the network, while the last octet is available for host addresses.
If a device has the wrong subnet mask configured, it may fail to communicate with local resources or incorrectly attempt to route local traffic to the internet gateway. This results in frustrating connectivity failures that are often misdiagnosed as hardware faults or ISP outages. Which means, verifying the correct subnet mask is usually step one in any network troubleshooting workflow.
And yeah — that's actually more nuanced than it sounds.
Finding the Subnet Mask on Windows
Windows provides several ways to view network configuration details, ranging from the user-friendly Settings app to the powerful Command Prompt and PowerShell interfaces.
Using the Settings App (Windows 10 & 11)
This is the most accessible method for users who prefer a Graphical User Interface (GUI) Easy to understand, harder to ignore..
- Press
Win + Ito open Settings. - figure out to Network & Internet.
- Select Wi-Fi or Ethernet, depending on your active connection.
- Click on Hardware properties (or the specific network name).
- Scroll down to the IPv4 address section. You will see the Subnet mask listed clearly (e.g.,
255.255.255.0).
Using Command Prompt (ipconfig)
For decades, ipconfig has been the standard tool for quick network verification.
- Press
Win + R, typecmd, and hit Enter. - Type
ipconfigand press Enter. - Locate your active adapter (look for Ethernet adapter or Wireless LAN adapter).
- Find the line labeled Subnet Mask. It will display the dotted-decimal notation.
Pro Tip: Use ipconfig /all to see the full configuration, including the DHCP server, lease expiration, and DNS suffixes, which provides deeper context for troubleshooting.
Using PowerShell (Get-NetIPConfiguration)
PowerShell offers a more object-oriented output, which is excellent for scripting or parsing specific data Small thing, real impact..
- Right-click the Start button and select Windows PowerShell (or Terminal).
- Run the command:
Get-NetIPConfiguration - The output lists InterfaceAlias, InterfaceDescription, and crucially, IPv4SubnetMask.
Finding the Subnet Mask on macOS
Apple’s operating system hides network details slightly deeper in the System Settings (or System Preferences on older versions), but the Terminal provides instant access for power users And that's really what it comes down to. Nothing fancy..
Via System Settings (GUI)
- Click the Apple menu () > System Settings (or System Preferences).
- Click Network in the sidebar.
- Select your active service (Wi-Fi or Ethernet) on the right.
- Click Details next to the connected network name.
- Select the TCP/IP tab. The Subnet Mask is displayed next to the IPv4 Address.
Via Terminal (ifconfig or ipconfig getpacket)
The Terminal is often faster for experienced users.
Method 1: ifconfig (Classic)
Type ifconfig and press Enter. Look for your active interface (usually en0 for Wi-Fi or en1 for Ethernet). Find the line starting with inet. The value following netmask is your subnet mask in hexadecimal (e.g., 0xffffff00). You may need to convert this to decimal (255.255.255.0) Easy to understand, harder to ignore..
Method 2: ipconfig getpacket (Cleaner Output)
For a human-readable decimal output, use the macOS specific tool:
ipconfig getpacket en0
(Replace en0 with your specific interface identifier).
Look for the subnet_mask (ip) field in the output. It displays the standard dotted-decimal format immediately And it works..
Finding the Subnet Mask on Linux
Linux distributions vary in their default toolsets (some use ifconfig, others ip, and some nmcli), but the ip command is the modern standard across almost all current distros.
Using the ip Command (Modern Standard)
Open your terminal and run:
ip addr show
Or the shorter version:
ip a
Look for the relevant interface (e.255.That's why 168. On the flip side, 255. In practice, , 192. 255., eth0, ens33, wlan0). Under the inet line, you will see the IP address followed by a slash and a number (e.g.1.** It represents the subnet mask. g.Even so, **This number (/24) is the CIDR prefix length. 50/24). 0, /16equals255.Think about it: /24 equals 255. Here's the thing — 0. 0, and so on Not complicated — just consistent..
Using nmcli (NetworkManager)
If you are on a desktop environment using NetworkManager (Ubuntu, Fedora, RHEL, CentOS), this command provides a clean, labeled output:
nmcli -p device show
Scroll to the IP4.SUBNET or IP4.ADDRESS field. It displays both the CIDR notation and often the expanded mask The details matter here..
Using ifconfig (Legacy/Deprecated)
On older systems or minimal containers, ifconfig might be the only tool available (often requires net-tools package installation).
Run ifconfig. Find the inet line. The netmask value is displayed in hex (e.g., 0xffffff00) or decimal depending on the version Still holds up..
Finding the Subnet Mask on Mobile Devices
Troubleshooting network issues on a phone or tablet is increasingly common, especially with MDM (Mobile Device Management) or complex Wi-Fi setups Most people skip this — try not to..
iOS / iPadOS
Apple does not show the subnet mask in the main Wi-Fi settings screen by default.
- Go to Settings > Wi-Fi.
- Tap the blue "i" icon next to the connected network.
- Scroll down to the IPV4 ADDRESS section.
- The Subnet Mask is listed directly below the IP Address.
Android (Stock / Pixel / Modern Versions)
The location varies slightly by manufacturer skin (OneUI, OxygenOS, MIUI), but the general path is:
- Open Settings > Network & Internet > Internet (or Wi-Fi).
- Tap the Gear icon or the network name for the connected network.
- Scroll down to Network details or Advanced.
- Look for Subnet mask under the IP settings. It is usually displayed as `2
It is usually displayed as `255.255.255 The details matter here. That's the whole idea..