On Windows, open Command Prompt and run ipconfig, then read Subnet Mask under your connected adapter. On macOS, go to System Settings, Network, Details, TCP/IP. On Linux, run ip address and read the prefix after the slash, such as /24, which equals 255.255.255.0.
Key takeaways
- On Windows, run ipconfig in Command Prompt and read Subnet Mask under the connected adapter.
- On Linux, ip address shows the mask as CIDR, such as /24, which equals 255.255.255.0.
- You cannot guess a subnet mask from an IP address alone; check the device, router or network admin.
Your subnet mask is already on your device, in your network settings. You do not need a special tool to find it, and you cannot guess it from an IP address alone. Here is how to read it on every common system.
What is a subnet mask?
A subnet mask splits an IP address into two parts: the network part and the host part. It tells your device which other addresses are on its local network and which ones need a router.
A common home mask is 255.255.255.0, written as /24 in CIDR notation. With that mask, a device at 192.168.1.20 treats 192.168.1.1 to 192.168.1.254 as local, and sends everything else to its default gateway.
The mask matters when you set a static IP, fix a network problem, or plan a small office network. If the mask is wrong, a device may think a local host is remote, or a remote host is local, and traffic will fail.
How do you find the subnet mask on Windows?
On Windows, open Command Prompt and run ipconfig, then read the Subnet Mask line under your connected adapter. That is the fastest method on Windows 10 and 11.
- Press the Windows key, type Command Prompt, and open it.
- Type
ipconfigand press Enter. - Find your connected adapter, usually Wireless LAN adapter Wi-Fi or Ethernet adapter Ethernet.
- Read Subnet Mask under that adapter, next to IPv4 Address and Default Gateway.
For full detail on every adapter, run ipconfig /all. That also shows the MAC address, whether DHCP is on, DNS servers and lease times. Microsoft's documentation says that without parameters, ipconfig displays the IPv4 and IPv6 addresses, subnet mask and default gateway for every adapter.
You can also use Settings. Open Settings, Network and internet, then Wi-Fi or Ethernet, select your connection, and read the mask in the network properties. The command line is faster and easier to copy into a support ticket.
How do you find the subnet mask on a Mac?
On a Mac, go to Apple menu, System Settings, Network, select Wi-Fi or Ethernet, click Details, then TCP/IP, and read Subnet mask in the IPv4 section.
- Open Apple menu, System Settings.
- Select Network in the sidebar.
- Choose Wi-Fi or Ethernet, whichever you are using.
- Click Details, then TCP/IP, and read Subnet mask.
In Terminal, you can also run networksetup -getinfo Wi-Fi, which prints the address, mask and router for that service in one summary. For the Wi-Fi interface, usually en0, ipconfig getoption en0 subnet_mask prints the same value.
Note that macOS ifconfig shows the mask in hexadecimal, such as 0xffffff00, which is just 255.255.255.0 written another way. Use networksetup -getinfo if you want the familiar decimal form.
How do you find the subnet mask on Linux?
On Linux, open Terminal and run ip address. Look for a line such as inet 192.168.1.20/24, where /24 is the prefix length, equal to 255.255.255.0.
Modern Linux uses the ip command from iproute2. The older ifconfig command is deprecated and often not installed at all, so use ip first.
ip addressorip addr: shows the address and prefix, such as 192.168.1.20/24.ip -4 addr show: shows IPv4 addresses only, which is easier to read.ip route: shows the default gateway and routing table.ip address show eth0: shows one interface only, if you know its name.
Linux generally displays prefixes as /n rather than dotted-decimal masks. Use the conversion table below to turn /24, /16 or another prefix into a dotted mask.
How do you find the subnet mask on iPhone and Android?
On iPhone, open Settings, Wi-Fi, tap the information icon next to your connected network, and read Subnet Mask under the IPv4 section. On Android, the path varies by maker, but it is usually in Wi-Fi settings.
On iPhone, the steps are: Settings, Wi-Fi, tap the small i next to the network name, then scroll to Subnet Mask. The same screen shows your IP address and router address.
On Android, open Settings, Network and internet or Connections, Wi-Fi, tap your connected network, then Advanced or View more. Some Android versions show the mask as a prefix, such as /24, rather than 255.255.255.0. If your phone shows only an IP address, use your router admin page to see the mask for the whole network.
How do you find the subnet mask on your router?
Log in to your router admin page and open the LAN or DHCP settings. The subnet mask is listed there for your whole local network, usually as 255.255.255.0.
- Find your gateway address from
ipconfigon Windows or the router field on Mac and iPhone. It is often 192.168.1.1 or 192.168.0.1. - Type that address into a browser and log in with your router admin password.
- Open LAN, DHCP or Network settings and read Subnet Mask.
The router page is the best place to check the mask for the whole network, rather than one device. If you change the mask here, every device that gets an address from DHCP will use the new value after it renews its lease.
If you cannot log in, check the label on the router for the default admin address and password, or ask the person who set the network up. Do not reset the router unless you know how to set it up again.
How do you convert CIDR to a subnet mask?
CIDR notation writes the mask as a prefix length after a slash, such as /24. The number is the count of network bits. The table below covers the prefixes you will see most often.
| CIDR | Subnet mask | Addresses | Usable hosts |
|---|---|---|---|
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
Usable hosts are total addresses minus two: the network address and the broadcast address. A /24 is the most common home and small-office size, with 254 usable hosts.
What are the most common subnet masks?
Most home networks use 255.255.255.0, or /24. Larger networks use wider masks, and point-to-point links use very narrow ones.
- 255.255.255.0 (/24): home and small-office networks, 254 usable hosts.
- 255.255.0.0 (/16): large private networks, 65,534 usable hosts.
- 255.0.0.0 (/8): very large networks, rarely used at home.
- 255.255.255.252 (/30): point-to-point links between two routers, 2 usable hosts.
- 255.255.255.255 (/32): a single host, used for loopback and host routes.
If you see 255.255.255.0 on a home network, that is normal. If you see a different mask on a device that should be on the same network, that device may have a static IP set by hand, or it may be on a different subnet.
What if the subnet mask looks wrong?
A wrong subnet mask usually shows up as a device that can reach some local hosts but not others, or a device that cannot reach the internet at all.
On Windows, if DHCP is on, run ipconfig /release followed by ipconfig /renew to drop and reacquire a lease. That often fixes a stale mask after a router change.
An address starting with 169.254 means the device did not get an address from DHCP at all. That is a different problem from a wrong mask: check the cable, Wi-Fi connection and DHCP server first.
For a wider network check, our guide to how to secure your Wi-Fi covers router settings that affect the whole home network.
The small business cybersecurity checklist covers network segmentation for small offices.
Microsoft documents the ipconfig output used here, as cited in the IPGeolocation subnet mask guide.
Apple documents the same TCP/IP steps for macOS, as cited in the MacMyths subnet mask guide.
The bottom line
On Windows, run ipconfig. On Mac, check Network, Details, TCP/IP. On Linux, run ip address and read the /n prefix. On a phone, check the Wi-Fi details for your connected network.
Write down the IP address, subnet mask and default gateway together when you report a network problem. Those three values, plus the DNS servers, are what support teams need first. You can check your visible public address in seconds with the free what is my IP tool.
Frequently asked questions
What is a subnet mask?
A subnet mask splits an IP address into a network part and a host part. It tells a device which other addresses are on its local network and which ones need a router. A common home mask is 255.255.255.0, written as /24 in CIDR notation.
How do I find my subnet mask on Windows 11?
Open Command Prompt, run ipconfig, and read Subnet Mask under the connected Wi-Fi or Ethernet adapter. You can also open Settings, Network and internet, then your connection, and read the mask in the network properties.
How do I find my subnet mask on a Mac?
Go to Apple menu, System Settings, Network, select Wi-Fi or Ethernet, click Details, then TCP/IP, and read Subnet mask. In Terminal, you can also run networksetup -getinfo Wi-Fi or ipconfig getoption en0 subnet_mask.
What does /24 mean in a subnet mask?
The /24 means the first 24 bits of the address are the network part. In dotted decimal, /24 equals 255.255.255.0 and allows 256 addresses, with 254 usable for hosts. The larger the number after the slash, the smaller the subnet.
How do I find my subnet mask on Linux?
Open Terminal and run ip address. Look for a line such as inet 192.168.1.20/24. The /24 is the prefix length, which equals 255.255.255.0. The older ifconfig command may not be installed on modern distributions.
Can I find the subnet mask from an IP address alone?
No, not reliably. Modern networks use CIDR, so any mask can be paired with any IP address. You need to check the device settings, the router admin page, or ask the network administrator for the actual mask.
Where is the subnet mask on my router?
Log in to your router admin page, usually at your gateway address such as 192.168.1.1, and open the LAN or DHCP settings. The subnet mask is listed there for your whole local network, often as 255.255.255.0.
What is the difference between a subnet mask and a default gateway?
The subnet mask defines which addresses are local. The default gateway is the router address that forwards traffic to other networks, including the internet. Both are shown together in ipconfig, network settings and router pages.
Sources
- MacMyths — What Is My Subnet Mask? Find It on Windows, Mac, Linux, iPhone and Android
- IPGeolocation — What Is a Subnet Mask? How It Works, Examples, Cheat Sheet
- ComputingForGeeks — Verify IP Settings: Windows, macOS, Linux
- NoBGP — Subnet Mask Cheat Sheet: /16 to /32 CIDR Table
- Everyday Tech — How to Find Your Subnet Mask on Windows, Mac, and Linux
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against Microsoft and Apple network documentation as cited in recent subnet mask guides, and CIDR conversion tables.
How we write and fact-check →