How to Find the Subnet Mask of an IP Address

Understanding your network's subnet mask is one of those tasks that sounds intimidating until you know where to look. Whether you're troubleshooting a connection, setting up a home network, or configuring a server, finding your subnet mask takes about 30 seconds once you know the right steps for your device.

What Is a Subnet Mask, and Why Does It Matter?

A subnet mask is a 32-bit number that works alongside an IP address to define two things: which part of the address identifies the network, and which part identifies the host (the specific device). It looks similar to an IP address — something like 255.255.255.0 — and it's always paired with one.

When your device communicates on a network, it uses the subnet mask to determine whether traffic should stay local or be routed out to the internet. Without a correct subnet mask, devices can't properly route data — even if every other setting is right.

The most common subnet masks you'll encounter:

Subnet MaskCIDR NotationCommon Use
255.255.255.0/24Home and small office networks
255.255.0.0/16Mid-size networks
255.0.0.0/8Large enterprise networks
255.255.255.128/25Divided subnets within organizations

How to Find Your Subnet Mask on Windows

The fastest method on any modern Windows machine is through the Command Prompt:

  1. Press Windows + R, type cmd, and hit Enter
  2. Type ipconfig and press Enter
  3. Look for your active connection (usually Ethernet adapter or Wi-Fi adapter)
  4. The Subnet Mask field is listed directly below the IPv4 address

If you want more detail, run ipconfig /all — this shows every network adapter on your system along with gateway addresses, DNS servers, and MAC addresses.

Alternatively, you can find it through Settings → Network & Internet → Properties on your active connection, though the command line method is faster and always reliable.

How to Find Your Subnet Mask on macOS

On a Mac, the subnet mask is visible in two places:

Via System Settings (macOS Ventura and later):

  • Go to System Settings → Network
  • Select your active connection (Wi-Fi or Ethernet)
  • Click Details
  • The subnet mask appears on the TCP/IP tab

Via Terminal:

  • Open Terminal and type: ifconfig | grep netmask
  • Your subnet mask appears as a hexadecimal value next to netmask — for example, 0xffffff00 translates to 255.255.255.0

The hex format trips people up. If you see 0xffffff00, convert each pair: ff = 255, ff = 255, ff = 255, 00 = 0.

How to Find Your Subnet Mask on Linux 🖥️

Linux users have several options depending on the distribution and tools installed:

  • ip addr show — modern method, shows the subnet in CIDR notation (e.g., 192.168.1.10/24)
  • ifconfig — older method, available if net-tools is installed
  • nmcli device show — useful on systems running NetworkManager

With CIDR notation, the /24 at the end tells you the subnet mask without spelling it out. A /24 equals 255.255.255.0, a /16 equals 255.255.0.0.

How to Find Your Subnet Mask on Android and iOS

Mobile devices display subnet mask information, though it's buried slightly deeper than on desktops.

On Android:

  • Go to Settings → Wi-Fi
  • Tap and hold (or tap the gear icon) on your connected network
  • Select Manage network settings or Advanced
  • Switch IP settings from DHCP to Static — the subnet mask becomes visible (you don't need to save any changes)

On iPhone or iPad:

  • Go to Settings → Wi-Fi
  • Tap the (i) icon next to your connected network
  • Scroll to the IPv4 Address section — the Subnet Mask is listed there directly

Finding the Subnet Mask Through Your Router

If you need the subnet mask for your entire network rather than a single device, your router's admin panel is the most authoritative source. Most home routers are accessible by typing 192.168.1.1 or 192.168.0.1 into a browser.

Once logged in, look under LAN settings, Network settings, or DHCP configuration — the subnet mask assigned to your local network is displayed there. This is also where you'd go to change it, which is relevant if you're segmenting a network or resolving IP conflicts. 🔧

Variables That Affect What You Find

The subnet mask you see depends on several factors that vary by setup:

  • Who assigned the IP address — if your device uses DHCP (automatic), the router or DHCP server chose the mask. If the IP is statically assigned, someone configured it manually.
  • Network size and design — home networks almost universally use /24 (255.255.255.0), while corporate networks often use custom masks to divide large address ranges into smaller segments.
  • IPv4 vs. IPv6 — subnet masks in the traditional sense apply to IPv4. IPv6 uses prefix length notation (e.g., /64) instead, and the concept works similarly but looks different.
  • Virtual machines and VPNs — if you're running virtualization software or connected to a VPN, your device may show multiple network adapters, each with its own subnet mask. The one that matters depends on which network you're troubleshooting.
  • ISP-assigned addresses — for WAN-side addresses (the IP your router gets from your ISP), the subnet mask is assigned by the ISP and usually not something you'd change.

Reading CIDR Notation vs. Dotted Decimal

You'll encounter subnet masks written two ways: dotted decimal (255.255.255.0) and CIDR notation (/24). They describe the same thing — how many bits of the address define the network.

A quick reference:

CIDRDotted DecimalUsable Hosts
/30255.255.255.2522
/28255.255.255.24014
/24255.255.255.0254
/22255.255.252.01,022
/16255.255.0.065,534

Knowing which format your tools display — and how to read both — saves real time when comparing configurations across different systems. 🌐

What the right subnet mask looks like for your situation depends entirely on the network you're managing, the scale of it, and whether you're diagnosing a problem or building something from scratch.