What a subnet is and why you need to find it
A subnet is the portion of an IP address that identifies which network a device belongs to, separate from which specific device it is on that network. When you have an IP address like 192.168.1.100, the subnet tells you that this device is on the 192.168.1.0 network, not on 192.168.2.0 or any other network. Finding the subnet matters because it determines which devices can talk to each other directly without going through a router, and it's essential information if you're troubleshooting network problems or setting up new devices.
The subnet is calculated using two pieces of information: the IP address itself and the subnet mask. The subnet mask is a number that looks similar to an IP address — for example, 255.255.255.0 — and it acts as a filter that separates the network portion from the device portion of the address. Once you know both the IP address and the subnet mask, you can determine the subnet in a few straightforward ways.
Key Takeaways
- The subnet mask on your device tells you which part of the IP address identifies the network; common masks are 255.255.255.0 for small networks and 255.255.0.0 for larger ones.
- On Windows, open Command Prompt and type ipconfig to see both your IP address and subnet mask in one place.
- On Mac or Linux, open Terminal and type ifconfig or ip addr to find the same information.
- Once you have the subnet mask, you can calculate the subnet by hand using a simple method, or use an online subnet calculator to do it instantly.
- The subnet tells you which other devices on your network can reach yours without a router in between.
Finding your subnet mask on Windows
On a Windows computer, the fastest way to see your subnet mask is through the Command Prompt. Press the Windows key, type cmd, and press Enter. In the window that opens, type ipconfig and press Enter. You will see a list of network adapters on your computer. Look for the one you are using — usually labeled "Ethernet" if you are plugged in with a cable, or "Wireless LAN adapter" if you are on Wi-Fi.
Under that adapter, you will see "IPv4 Address" (your IP address) and directly below it "Subnet Mask". Write down both numbers. For example, you might see an IPv4 Address of 10.0.0.50 and a Subnet Mask of 255.255.255.0. These two pieces are all you need to find your subnet.
Finding your subnet mask on Mac or Linux
On a Mac, open Terminal (search for it in Spotlight or find it in Applications > Utilities). Type ifconfig and press Enter. You will see information for each network adapter. Look for the one you are using — en0 or en1 for Ethernet, en0 for Wi-Fi on newer Macs. The line labeled "inet" shows your IP address, and the line labeled "netmask" shows your subnet mask in hexadecimal format (it will look like 0xffffff00 instead of 255.255.255.0).
On Linux, open a terminal and type ip addr or ifconfig depending on your distribution. The output will show your IP address and subnet mask. The subnet mask may be shown as a slash followed by a number — for example, /24 — which is shorthand notation. A /24 means the first 24 bits of the address are the network, which is the same as 255.255.255.0.
Converting a subnet mask to find your subnet
Once you have your IP address and subnet mask, you can calculate the subnet by performing a bitwise AND operation, which sounds complicated but is straightforward in practice. The easiest method is to use an online subnet calculator — search for "subnet calculator" and paste in your IP address and subnet mask. The calculator will instantly show you the subnet address.
If you want to do it by hand, the process depends on your subnet mask. For the most common mask, 255.255.255.0, simply change the last number of your IP address to 0. So if your IP is 192.168.1.100, your subnet is 192.168.1.0. For a mask of 255.255.0.0, change the last two numbers to 0 — so 10.5.200.50 becomes 10.5.0.0. For less common masks like 255.255.255.128, the calculation requires converting to binary, which is why a calculator is faster and more reliable.
Understanding what the subnet tells you
Once you know your subnet, you know which devices can reach your computer directly on the local network. Any device with an IP address on the same subnet as yours can communicate with you without needing a router to forward the traffic. For example, if your subnet is 192.168.1.0 with a mask of 255.255.255.0, then devices with addresses like 192.168.1.50, 192.168.1.101, and 192.168.1.200 are all on your subnet. A device at 192.168.2.50 is not on your subnet and would need a router to reach you.
This matters for troubleshooting. If a device on your network is not responding, one first check is whether it is on the same subnet as you. If it is not, the problem may be a router configuration rather than a problem with the device itself. It also matters when you are setting up a new device — if you manually assign an IP address, you need to make sure it is on the same subnet as your other devices, or they will not be able to find it.
Subnet notation shortcuts you may see
Network administrators often write subnets in shorthand called CIDR notation. Instead of writing "IP address 192.168.1.100 with subnet mask 255.255.255.0", they write "192.168.1.100/24". The number after the slash is the number of bits in the subnet mask. A /24 means 24 bits are the network portion, which equals 255.255.255.0. A /16 means 16 bits, which equals 255.255.0.0. A /32 is a single device.
If you see CIDR notation and need to convert it back to a traditional subnet mask, a subnet calculator can do that instantly. But for most home and small office networks, you will only encounter /24 (255.255.255.0) or /16 (255.255.0.0), and knowing those two is usually enough.
Frequently Asked Questions
What is the difference between a subnet and a subnet mask?
The subnet mask is the tool you use to calculate the subnet. The subnet is the result — the actual network address. Think of the mask as a stencil and the subnet as the pattern it reveals.
Can two devices on different subnets talk to each other?
Yes, but only through a router. Devices on the same subnet can talk directly. Devices on different subnets must send traffic through a router, which adds a step and may be blocked by firewall rules.
Why does my subnet mask have numbers other than 255 or 0?
Some networks use non-standard subnet masks like 255.255.255.128 or 255.255.255.192 to divide a network into smaller pieces. These are less common in home networks but appear in larger corporate setups. A subnet calculator will handle them correctly.
If I change my subnet mask, does my IP address change?
No. Your IP address stays the same, but the subnet you are on changes. Changing the subnet mask is a way to reorganize which devices can reach each other directly, but it is rarely necessary in home networks and can break connectivity if done incorrectly.